forked from rosebudai/OpenRCT2-Web
Let handymen check if a tile is being serviced by another handyman (#26639)
This commit is contained in:
1 parent
d4df0267b4
commit
50d91c4e5f
4 files changed
+38
-3
No files matched your search
@@ -263,6 +263,7 @@ Appreciation for contributors who have provided substantial work, but are no lon
|
||||
* Sjoerd de Bruin (sjoerddebruin)
|
||||
* Alex Harvey (loonyduck1)
|
||||
* Daniel Rödl (danielroedl)
|
||||
* Michael Hlas (mhlas7)
|
||||
|
||||
## Toolchain
|
||||
* (Balletie) - macOS
|
||||
|
||||
@@ -5,6 +5,7 @@
|
||||
- Improved: [#26747] Exporting a sprite file now also outputs a JSON file, allowing for round-trip conversions.
|
||||
- Improved: [#26763] The ride colour/appearance tab now visually separates fields using group boxes.
|
||||
- Improved: [#26765] The ride operations tab now visually separates fields using group boxes.
|
||||
- Fix: [#26639] Handymen could begin a task while another handyman was already doing the exact same task.
|
||||
- Fix: [#26756] Guests cannot puke or litter on sloped path.
|
||||
- Fix: [#26758] [Plugin] IPv6 addresses are reported incorrectly.
|
||||
- Fix: [#26775] Maze gets wrong intensity boost from size (0.02 per tile instead of 0.01 per 2 tiles).
|
||||
|
||||
@@ -387,6 +387,28 @@ namespace OpenRCT2
|
||||
return nextDirection;
|
||||
}
|
||||
|
||||
static bool isHandymanAlreadyServicingTile(const CoordsXY& tile, PeepState state)
|
||||
{
|
||||
if (state == PeepState::watering)
|
||||
{
|
||||
for (auto* staff : EntityList<Staff>())
|
||||
{
|
||||
if (staff->State == PeepState::watering
|
||||
&& CoordsXY{ staff->NextLoc } + CoordsDirectionDelta[staff->Var37] == tile)
|
||||
return true;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
for (auto* staff : EntityTileList<Staff>(tile))
|
||||
{
|
||||
if (staff->State == state)
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* rct2: 0x006BF931
|
||||
@@ -433,7 +455,8 @@ namespace OpenRCT2
|
||||
{
|
||||
if (surfaceElement->CanGrassGrow() && (surfaceElement->GetGrassLength() & 0x7) >= GRASS_LENGTH_CLEAR_1)
|
||||
{
|
||||
return chosenDirection;
|
||||
if (!isHandymanAlreadyServicingTile(chosenTile, PeepState::mowing))
|
||||
return chosenDirection;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1507,6 +1530,9 @@ namespace OpenRCT2
|
||||
}
|
||||
}
|
||||
|
||||
if (isHandymanAlreadyServicingTile(chosenLoc, PeepState::watering))
|
||||
continue;
|
||||
|
||||
SetState(PeepState::watering);
|
||||
Var37 = chosen_position;
|
||||
|
||||
@@ -1575,6 +1601,9 @@ namespace OpenRCT2
|
||||
if (chosen_position == 4)
|
||||
return false;
|
||||
|
||||
if (isHandymanAlreadyServicingTile(CoordsXY{ NextLoc }, PeepState::emptyingBin))
|
||||
return false;
|
||||
|
||||
Var37 = chosen_position;
|
||||
SetState(PeepState::emptyingBin);
|
||||
|
||||
@@ -1602,7 +1631,8 @@ namespace OpenRCT2
|
||||
auto surfaceElement = MapGetSurfaceElementAt(NextLoc);
|
||||
if (surfaceElement != nullptr && surfaceElement->CanGrassGrow())
|
||||
{
|
||||
if ((surfaceElement->GetGrassLength() & 0x7) >= GRASS_LENGTH_CLEAR_1)
|
||||
if ((surfaceElement->GetGrassLength() & 0x7) >= GRASS_LENGTH_CLEAR_1
|
||||
&& !isHandymanAlreadyServicingTile(CoordsXY{ NextLoc }, PeepState::mowing))
|
||||
{
|
||||
SetState(PeepState::mowing);
|
||||
Var37 = 0;
|
||||
@@ -1632,6 +1662,9 @@ namespace OpenRCT2
|
||||
if (z_diff >= 16)
|
||||
continue;
|
||||
|
||||
if (isHandymanAlreadyServicingTile(litter->getLocation(), PeepState::sweeping))
|
||||
continue;
|
||||
|
||||
SetState(PeepState::sweeping);
|
||||
|
||||
Var37 = 0;
|
||||
|
||||
@@ -48,7 +48,7 @@
|
||||
// It is used for making sure only compatible builds get connected, even within
|
||||
// single OpenRCT2 version.
|
||||
|
||||
constexpr uint8_t kStreamVersion = 2;
|
||||
constexpr uint8_t kStreamVersion = 3;
|
||||
|
||||
const std::string kStreamID = std::string(kOpenRCT2Version) + "-" + std::to_string(kStreamVersion);
|
||||
|
||||
|
||||
Reference in new issue
Block a user