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(); exits &= exits_viable; shops &= exits_viable; } /** * Prevent people from wandering out of the park. * @return exits Exits from the current tile that stay or lead into the park in * the low nibble. */ uint8 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()) continue; if (this->y_vox + dxy.y < 0 || this->y_vox + dxy.y >= _world.GetYSize()) continue; if (_world.GetTileOwner(this->x_vox + dxy.x, this->y_vox + dxy.y) != OWN_PARK) { SB(exits, exit_edge, 1, 0); } } return exits; }