Exception handling – Talk

From Bohemia Interactive Community
Revision as of 20:40, 22 July 2006 by TeRp (talk | contribs)
Jump to navigation Jump to search

Can the if statement handle numbers? Because emptyPositions returns a number and not a boolean. --T_D 20:07, 22 July 2006 (CEST)

IMHO every number larger than zero means true. --Djura 20:38, 22 July 2006 (CEST)

firebomb.sqs example

The first if in the 'firebomb.sqs example is incorrect. you are using a || = conditional OR here, so the code throw "vehicle empty" will be executed if there one of the conditions returns true. your intention was to get this code exectued when there is noone in the vehicle, so you should use && = conditional OR. Additionaly, this code is unnecessary. a simple (crew vehicle == 0) will be much more effective. --TeRp 20:40, 22 July 2006 (CEST)