Prev: 39882 Up: Map Next: 39959
39900: Object: Move Contents
Moves everything inside the object in A (recursively) to the location in B; if the player is among them, the player moves too. The byte here is set while the player has not been found among those contents.
Object_MoveContents 39900 DEFB 255
Object_MoveContents_0 39901 LD HL,39900 Point HL at the flag that says the player was not found.
39904 LD (HL),1 Set the flag.
39906 CALL Object_MoveContents_Recurse Call Object_MoveContents_Recurse to move the contents.
39909 LD A,(HL) Return if the player was not among the contents (the flag at Object_MoveContents is still set).
39910 AND A
39911 RET NZ
39912 PUSH HL Save HL.
Test this flag.
39913 LD A,(49451) Jump to Object_MoveContents_ClearAndReturn if *49451 is zero.
39916 AND A
39917 JR Z,Object_MoveContents_ClearAndReturn
39919 LD A,(46826) Read *CurrentCharacter.
39922 PUSH AF Read *Pointer_CurrentCharacter.
39923 LD HL,(46860)
39926 PUSH HL Point *Pointer_CurrentCharacter at "You".
39927 LD HL,49435
39930 LD (46860),HL
39933 XOR A Clear *CurrentCharacter.
39934 LD (46826),A
39937 LD A,B Store B at ActionLocationID.
39938 LD (36251),A
39941 CALL Action_Direction_0 Call Action_Direction_0 to move the character, unless the message is held back.
39944 CALL Action_None Call Action_None, the empty action.
39947 POP HL Update *Pointer_CurrentCharacter.
39948 LD (46860),HL
39951 POP AF Update *CurrentCharacter.
39952 LD (46826),A
Object_MoveContents_ClearAndReturn 39955 POP HL Restore HL from the stack and clear the byte it points at.
39956 XOR A
39957 LD (HL),A
39958 RET Return.
Prev: 39882 Up: Map Next: 39959