Prev: 49191 Up: Map Next: 49301
49262: Spawn Task Entity
Used by the routine at Update_Entity_Slot.
Spawn Task Entity for the current Thing Upstairs task.
Spawns a pan into a free complex-entity slot.
Spawn_Task_Entity 49262 PUSH HL Stash HL on the stack.
49263 LD IY,36949 Point IY at the pan entity (StateData_Complex_26).
49267 SET 7,(IY+2) Set bit 7 of the referenced entity's flags byte 2.
49271 LD HL,29365 Point HL at the task-two flags (TaskTwoFlags).
49274 RES 4,(HL) Clear bit 4 of TaskTwoFlags (also set at 49362. no BIT reader found).
49276 RES 5,(HL) Clear bit 5 of TaskTwoFlags (also set at 49364 / cleared at 49393. no BIT reader found).
49278 SET 7,(HL) Set bit 7 of TaskTwoFlags.
49280 LD A,(29375) Load A with the room-transition flag (RoomTransitionFlag).
49283 INC A Advance room-transition flag by one.
49284 LD (29375),A Set the room-transition flag (RoomTransitionFlag).
49287 CP 4 Is room-transition flag equal to 4? If not, jump to Spawn_Task_Entity_PanLayout.
49289 JR NZ,Spawn_Task_Entity_PanLayout
49291 SET 6,(HL) Set bit 6 of TaskTwoFlags (written here when RoomTransitionFlag reaches 4 no BIT reader found).
Point the helper entity at layout GraphicLayout_Pan after arming spawn flags.
Spawn_Task_Entity_PanLayout 49293 LD HL,40455 Point HL at the pan layout GraphicLayout_Pan.
49296 LD (36959),HL Write the layout pointer into the helper entity's layout field (36959).
49299 POP HL Restore HL from the stack.
49300 RET Return.
Prev: 49191 Up: Map Next: 49301