![]() |
Routines |
| Prev: 47450 | Up: Map | Next: 47481 |
|
Used by the routine at BlockMovement.
Stops an object from going through the floor. If the z position of the object after it has moved is below the floor of the room, the object is flagged as blocked along z, and its speed along z is brought closer to zero until the object no longer goes through the floor.
|
||||||||||||||
|
Test the floor and slow z.
|
||||||||||||||
| StopObjectAtFloor | 47459 | LD A,(42783) | Fetch FloorHeight. | |||||||||||
| 47462 | LD D,A | Copy it to D. | ||||||||||||
|
Slow z until the object stays above the floor.
|
||||||||||||||
| StopObjectAtFloor_Test | 47463 | LD A,(IX+3) | Fetch the z position of the object. | |||||||||||
| 47466 | ADD A,H | Return if the object does not end up below the floor. | ||||||||||||
| 47467 | CP D | |||||||||||||
| 47468 | RET NC | |||||||||||||
| 47469 | SET 2,(IX+12) | Flag that the object has been stopped along z, which is on the ground. | ||||||||||||
| 47473 | LD A,H | Copy H to A. | ||||||||||||
| 47474 | CALL BringSpeedCloserToZero | Call BringSpeedCloserToZero. | ||||||||||||
| 47477 | LD H,A | Copy it to H. | ||||||||||||
| 47478 | JR NZ,StopObjectAtFloor_Test | Jump to StopObjectAtFloor_Test to test again, unless the distance is zero. | ||||||||||||
| 47480 | RET | Return. | ||||||||||||
|
View the equivalent code in;
|
||||||||||||||
| Prev: 47450 | Up: Map | Next: 47481 |