Prev: 34876 Up: Map Next: 35180
35151: Afford To Fly Check
Used by the routines at ChooseLocationOrTakeJob and Handler_SubGame.
Input
IX The active player; either 1UP_Name or 2UP_Name
Check_AffordToFly 35151 LD L,(IX+8) Fetch the players current location and store it in HL.
35154 LD H,(IX+9)
35157 LD DE,6 Move HL by 0006 to point to the destination cost.
35160 ADD HL,DE
35161 LD E,(HL) Load the cost of this destination into DE.
35162 INC HL
35163 LD D,(HL)
35164 LD L,(IX+13) Loads the active players cash balance into HL.
35167 LD H,(IX+14)
35170 AND A Subtract the cost of the destination from the active players cash balance.
35171 SBC HL,DE
35173 LD HL,61434 Return if the player can afford the "cheapest" destination.
35176 RET NC
Else, the player is stuck in their current destination. Set the flag for this.
35177 SET 5,(HL) Set bit 5 ("Can't Afford To Fly") of *GameState_1.
35179 RET Return.
Prev: 34876 Up: Map Next: 35180