Quote:
Originally Posted by Skoshi Tiger
The break statement terminates the closest enclosing loop or switch statement in which it appears. Control is passed to the statement that follows the terminated statement, if any.
Is this the break you are talking about?
I think the break statement will drop out of the foreach loop. As far as I can see the purpose of the code is to see if any of the planes contained in array ps have a player inside. If any of the array locations contains a player then the loop does not have to continue.
The next section of code checks 'aircraftWillBeDestroyed' if player is present then this is set to false and the section that destroys the aircraft will be skipped.
Cheers!
|
yes the break u mention here interrupts the foreach loop because we found a player inside the plane queued for destroy and there is no need to check other players,this will be a waste of time, there is possibly someone else entered this plane in the meantime and the plane must not be destroyed, i set a boolean value (aircraftWillBeDestroyed) to hold the result because the code continues to execute after foreach loop according to this result.
lol no, sorry i misunderstood, its the "break command" (key command) set in options-controls-builder, exits free view mode in fmb and deselects current object, could be handy if you fine tune the positions of objects in free view mode a lot, by the way this is what i use it for, may be intended for something else.