Skip to navigation

Gameplay: AbortWhenVisible

Name: AbortWhenVisible [Show more] Type: Subroutine Category: Gameplay Summary: Abort applying the tactics for this gameplay loop if updating the object on-screen will corrupt a screen pan
Context: See this subroutine in context in the source code References: This subroutine is called as follows: * ApplyTactics (Part 2 of 8) calls AbortWhenVisible * ApplyTactics (Part 6 of 8) calls AbortWhenVisible * DrainObjectEnergy calls AbortWhenVisible

Arguments: A The number of the object to check
.AbortWhenVisible JSR CheckObjVisibility \ Check whether object A is visible and could therefore \ be seen on-screen by the player BCS cvis1 \ If the C flag is clear then the object is partially \ on-screen and we are about to repeat a screen pan, so \ the object must not be updated or it could corrupt the \ landscape view, so in this case fall through into \ FinishEnemyTactics to stop applying tactics for this \ gameplay loop \ \ Otherwise the C flag is set so we can safely update \ the object without fear of corrupting a screen pan, \ so we can jump to cvis1 to return from the subroutine \ without aborting the tactics routine