Prev: 27153 Up: Map Next: 27183
27158: Action: Set Object Location
Writes a new location for the object. A value of 1 for an object numbered 70 or higher is stored as zero. If the new location is the current room, the room is marked changed.
Input
A New location
B Object number
SetObjectLocation 27158 CALL ObjectAddress Call ObjectAddress.
27161 LD C,A C is the new location.
27162 LD A,B An index below 70 is stored as given.
27163 CP 70
27165 JR C,SetObject_Write
27167 LD A,C Jump to SetObject_Write if the location is 1.
27168 CP 1
27170 JR Z,SetObject_Write
27172 LD C,0 Store 0 instead.
Write the new location.
SetObject_Write 27174 LD (HL),C Write the location.
This entry point is used by the routine at CopyObjectLocation.
Redraw if the object is here.
SetObject_Here 27175 LD HL,23943 Point HL at CurrentRoom.
27178 CP (HL) Jump to RoomHasChanged if it is *CurrentRoom.
27179 JP Z,RoomHasChanged
27182 RET Return.
Prev: 27153 Up: Map Next: 27183