-
-
Notifications
You must be signed in to change notification settings - Fork 534
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
wzapi: check and process deferred object removals in more places
These places include not only those which involve triggers upon `droidUpdate()` inside the main execution sequence of the game loop, but also those events that execute prior to and after the main things in the game loop, e.g.: * Level start. * Load/Save game. * Start playing videos. * Render loop. Some of these places may be just extra work and probably won't have even a slight possibility of calling `wzapi::removeObject` from inside them, but it's always better to be safe than sorry. Also, introduce a check for already-dead entries in `processScriptQueuedObjectRemovals()` and skip them. This is a way to deal with duplicate entries to ensure we don't destroy a single object more than once. These things can occur when, e.g., several units happen to move near enough to an artifact lying on the ground, so that they would pick up the artifact simultaneously within the same game loop iteration (in the `checkLocalFeatures()` function). In such case, each of these droids will trigger the "artifact picked up" event, so JS handler (`cam_eventPickup`) will be called multiple times for the same object, each trying to place it into `scriptQueuedObjectRemovals()` list. Signed-off-by: Pavel Solodovnikov <[email protected]>
- Loading branch information
Showing
8 changed files
with
41 additions
and
22 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters