1
0
mirror of https://github.com/OpenRCT2/OpenRCT2 synced 2026-01-22 14:24:33 +01:00

Remove direct access to DirectionX and DirectionY

This commit is contained in:
Matt
2021-02-10 20:47:11 +02:00
parent 2bb5bb9988
commit 965041b437
9 changed files with 123 additions and 158 deletions

View File

@@ -424,11 +424,12 @@ void footpath_interrupt_peeps(const CoordsXYZ& footpathPos)
{
if (peep->State == PeepState::Sitting || peep->State == PeepState::Watching)
{
if (peep->z == footpathPos.z)
auto location = peep->GetLocation();
if (location.z == footpathPos.z)
{
auto destination = location.ToTileCentre();
peep->SetState(PeepState::Walking);
peep->DestinationX = (peep->x & 0xFFE0) + 16;
peep->DestinationY = (peep->y & 0xFFE0) + 16;
peep->SetDestination(destination);
peep->DestinationTolerance = 5;
peep->UpdateCurrentActionSpriteType();
}