if (this->activity == GA_WANDER || this->activity == GA_QUEUING) { // Prevent wandering and queuing guests from walking out the park.
uint8 exits_viable = this->Person::HandleParkExits(); // Handle guests trying to wander out.
exits &= exits_viable;
shops &= exits_viable;
}
/**
* Prevent people from wandering out of the park.
* @return exits Possible exits at the tile.
*/
void Person::HandleParkExits()
{
uint8 exits = 0xF;
for (TileEdge exit_edge = EDGE_BEGIN; exit_edge != EDGE_COUNT; exit_edge++) {
Point16 dxy = _tile_dxy[exit_edge];
if (this->x_vox + dxy.x < 0 || this->x_vox + dxy.x >= _world.GetXSize() * 256 ||
this->y_vox + dxy.y < 0 || this->y_vox + dxy.y >= _world.GetYSize() * 256 ||
_world.GetTileOwner(this->x_vox + dxy.x, this->y_vox + dxy.y) != OWN_PARK) {
SB(exits, exit_edge, 1, 0);
}
}
return exits;
}