Posted By: Loremaster
Return value of c_trace? - 02/05/13 01:33
I use the following line of code to evaluate whether there is a line of sight between player and NPC.
I assumed if the trace hits the player unhindered, the return value would be 0. My if-statement therefore triggers the NPC-action if it is 0.
It does not trigger it. What do I do wrong?
Code:
if (c_trace( my.x, player.x, IGNORE_ME|IGNORE_PASSENTS|IGNORE_PASSABLE|IGNORE_SPRITES) == 0) { FancyNPCFunction() }
I assumed if the trace hits the player unhindered, the return value would be 0. My if-statement therefore triggers the NPC-action if it is 0.
It does not trigger it. What do I do wrong?