Exception handling – Talk

From Bohemia Interactive Community
Jump to navigation Jump to search
(Answer)
(No difference)

Revision as of 13:45, 19 December 2006

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 one of the conditions returns true. your intention was to get this code exectued when there is nobody in the vehicle, so you should use && = conditional AND. Additionaly, this code is unnecessary. a simple (crew vehicle == 0) would be much more effective. --TeRp 20:40, 22 July 2006 (CEST)

You are right. I didn't know about crew command. --Djura 20:48, 22 July 2006 (CEST)