Use CoordsXYZ on footpath_interrupt_peeps()

This commit is contained in:
Tulio Leao committed 2020-01-11 11:13:04 -03:00
1 parent 9aad709d5c
commit 2b1101d320
7 files changed
+10 -10

No files matched your search

+1 -1
View File
@@ -117,7 +117,7 @@ public:
if (!(GetFlags() & GAME_COMMAND_FLAG_GHOST))
{
footpath_interrupt_peeps(_loc.x, _loc.y, _loc.z);
footpath_interrupt_peeps(_loc);
}
gFootpathGroundFlags = 0;
@@ -98,7 +98,7 @@ public:
if (!(GetFlags() & GAME_COMMAND_FLAG_GHOST))
{
footpath_interrupt_peeps(_loc.x, _loc.y, _loc.z);
footpath_interrupt_peeps(_loc);
}
gFootpathGroundFlags = 0;
@@ -78,7 +78,7 @@ public:
if (!(GetFlags() & GAME_COMMAND_FLAG_GHOST))
{
footpath_interrupt_peeps(_loc.x, _loc.y, _loc.z);
footpath_interrupt_peeps(_loc);
footpath_remove_litter(_loc.x, _loc.y, _loc.z);
}
@@ -176,7 +176,7 @@ public:
}
else
{
footpath_interrupt_peeps(_loc.x, _loc.y, _loc.z);
footpath_interrupt_peeps(_loc);
}
if ((_pathItemType != 0 && !(GetFlags() & GAME_COMMAND_FLAG_GHOST))
@@ -99,7 +99,7 @@ public:
if (!(GetFlags() & GAME_COMMAND_FLAG_GHOST))
{
footpath_interrupt_peeps(_loc.x, _loc.y, _loc.z);
footpath_interrupt_peeps(_loc);
}
if (pathElement == nullptr)
+4 -4
View File
@@ -421,9 +421,9 @@ void footpath_remove_litter(int32_t x, int32_t y, int32_t z)
*
* rct2: 0x0069A48B
*/
void footpath_interrupt_peeps(int32_t x, int32_t y, int32_t z)
void footpath_interrupt_peeps(const CoordsXYZ& footpathPos)
{
uint16_t spriteIndex = sprite_get_first_in_quadrant(x, y);
uint16_t spriteIndex = sprite_get_first_in_quadrant(footpathPos.x, footpathPos.y);
while (spriteIndex != SPRITE_INDEX_NULL)
{
Peep* peep = &get_sprite(spriteIndex)->peep;
@@ -432,7 +432,7 @@ void footpath_interrupt_peeps(int32_t x, int32_t y, int32_t z)
{
if (peep->state == PEEP_STATE_SITTING || peep->state == PEEP_STATE_WATCHING)
{
if (peep->z == z)
if (peep->z == footpathPos.z)
{
peep->SetState(PEEP_STATE_WALKING);
peep->destination_x = (peep->x & 0xFFE0) + 16;
@@ -917,7 +917,7 @@ static void loc_6A6D7E(
}
if (!(flags & (GAME_COMMAND_FLAG_GHOST | GAME_COMMAND_FLAG_ALLOW_DURING_PAUSED)))
{
footpath_interrupt_peeps(targetPos.x, targetPos.y, tileElement->GetBaseZ());
footpath_interrupt_peeps({ targetPos, tileElement->GetBaseZ() });
}
map_invalidate_element(targetPos, tileElement);
}
+1 -1
View File
@@ -178,7 +178,7 @@ extern const LocationXY16 BenchUseOffsets[NumOrthogonalDirections * 2];
TileElement* map_get_footpath_element(CoordsXYZ coords);
struct PathElement;
PathElement* map_get_footpath_element_slope(int32_t x, int32_t y, int32_t z, int32_t slope);
void footpath_interrupt_peeps(int32_t x, int32_t y, int32_t z);
void footpath_interrupt_peeps(const CoordsXYZ& footpathPos);
money32 footpath_remove(CoordsXYZ footpathLoc, int32_t flags);
money32 footpath_provisional_set(int32_t type, CoordsXYZ footpathLoc, int32_t slope);
void footpath_provisional_remove();