assertion - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (
https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (
https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: assertion (
/showthread.php?tid=420023)
assertion -
Mean - 03.03.2013
I've been told assertion should not be used unless I'm trying to find errors that the compiler can't find.
pawn Код:
assert(gPlayerInfo[playerid][pAdmin]);
I know assertion wasn't normally meant to be used this way,
but what's the harm in using it like that? (this is my question)
Doesn't that code do the same as:
pawn Код:
if(!gPlayerInfo[playerid][pAdmin]) return (0);
?
Re: assertion -
Mean - 03.03.2013
Quote:
Originally Posted by ******
No, that code stops your script entirely. It has found a fatal error and dies, "if" just returns to the caller.
|
alright thanks
(you have given out too much rep in the past 24 hr, try again later)