Setting the player on fire is not yet possible through the API (and even MCServer does a really poor job, especially of un-setting the fire). We haven't yet reached a consensus on where exactly to put the fire handling, whether into cEntity or cPawn.
To elaborate on that a bit, although I'm gonna be talking C/C++ here, it might be different in Lua: Imagine you have two bool values and want to compare them. An unsuspecting victim might try a simple code like
Doing a comparison like
From another point of view, using code like this is somewhat misleading:
So the best practice is to use bool values directly:
(05-01-2013, 06:02 AM)xoft Wrote: Definitely NOT. Do NOT compare boolean values, that's bad practice in C++ and makes the code less readable.
To elaborate on that a bit, although I'm gonna be talking C/C++ here, it might be different in Lua: Imagine you have two bool values and want to compare them. An unsuspecting victim might try a simple code like
if (BoolVal1 == BoolVal2)However, this won't work. The compiler is free to use zero for false and nonzero for true, which means two values that are logically true needn't be actually equal. "5" is true, "7" is true, but 5 != 7.
Doing a comparison like
if (BoolVal == true)you're comparing BoolVal's value (which could be a number, really) with "1" or "-1" or even "255", depending on the compiler.
From another point of view, using code like this is somewhat misleading:
if (ShouldDoIt == false)
So the best practice is to use bool values directly:
if (ShouldDoIt) { DoIt(); } if (!ShouldExit) { DoIt(); }