Prev: 45801 Up: Map Next: 45879
45848: Create Direction Pointer
Used by the routine at CreateTownObjects.
Called every frame in the town. Puts a pointing hand (an object of type 11) in the sixth object slot, next to the sheriff, if the slot is free. HandlePointer makes it point towards the outlaw.
Use the sixth slot if it is free.
CreateDirectionPointer 45848 LD DE,41677 Point DE at the sixth object slot.
45851 LD A,(DE) Fetch the type of the object in the slot.
45852 AND A Return if the slot is in use.
45853 RET NZ
Copy the template and place the pointer near the sheriff.
45854 PUSH DE Copy DE to IY (using the stack).
45855 POP IY
45857 LD HL,45879 Point HL at PointerTemplate.
45860 LD BC,16 Set the size of an object slot in BC.
45863 LDIR Copy the template into the slot.
45865 LD B,1 Set the distance from the sheriff to one cell.
45867 CALL PlaceNearSheriff Place the pointer one cell away from the sheriff.
45870 RET NZ Return if that cell is blocked.
45871 CALL SetPositionInCell Set the position of the pointer within its cell.
45874 LD (IY+0),11 Turn the slot into a pointer.
45878 RET Return.
Prev: 45801 Up: Map Next: 45879