Quote:
Originally Posted by Syfon
Does the bot see through the smoke?
|
Yes . Normally there is some checks need to be done inside trace between attacker and victim.
Code:
//Simply trace to target. NOTE: this is just trace example, to check for doors, boxes need to be done more.
stock bool: Function_MonsterDetection(Float: iOrigin[3], Float: fOrigin[3], bool: IGNORE_PLAYER = true)
{
new TRACE = NULL;
engfunc(EngFunc_TraceLine, iOrigin, fOrigin, (IGNORE_PLAYER ? IGNORE_MONSTERS : DONT_IGNORE_MONSTERS), NULL, TRACE);
new Float: flFraction;
get_tr2(TRACE, TR_flFraction, flFraction);
/*Should add here view in cone, if you want to make pBot only target
player on his view angles.*/
if(flFraction == 1.0)
return true;
return false;
}