assertion
#1

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);
?
Reply
#2

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)
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)