diff --git a/src/openrct2/world/Map.cpp b/src/openrct2/world/Map.cpp index 0f2315c8a0..a490e39f7f 100644 --- a/src/openrct2/world/Map.cpp +++ b/src/openrct2/world/Map.cpp @@ -23,6 +23,7 @@ #include "../core/Guard.hpp" #include "../entity/Duck.h" #include "../entity/EntityTweener.h" +#include "../entity/Fountain.h" #include "../entity/PatrolArea.h" #include "../entity/Staff.h" #include "../interface/Cursors.h" @@ -2354,6 +2355,15 @@ void ShiftMap(const TileCoordsXY& amount) } break; } + case EntityType::JumpingFountain: + { + auto fountain = entity->As(); + if (fountain != nullptr) + { + fountain->TargetX += amountToMove.x; + fountain->TargetY += amountToMove.y; + } + } default: break; } @@ -2409,4 +2419,6 @@ void ShiftMap(const TileCoordsXY& amount) } id = BannerIndex::FromUnderlying(id.ToUnderlying() + 1); } + + ShiftAllMapAnimations(amountToMove); } diff --git a/src/openrct2/world/MapAnimation.cpp b/src/openrct2/world/MapAnimation.cpp index 9c1751d48b..690c62f779 100644 --- a/src/openrct2/world/MapAnimation.cpp +++ b/src/openrct2/world/MapAnimation.cpp @@ -709,3 +709,14 @@ void MapAnimationAutoCreateAtTileElement(TileCoordsXY coords, TileElement* el) break; } } + +void ShiftAllMapAnimations(CoordsXY amount) +{ + if (amount.x == 0 && amount.y == 0) + return; + + for (auto& a : _mapAnimations) + { + a.location += amount; + } +} diff --git a/src/openrct2/world/MapAnimation.h b/src/openrct2/world/MapAnimation.h index ddbdabe18e..fff54969c5 100644 --- a/src/openrct2/world/MapAnimation.h +++ b/src/openrct2/world/MapAnimation.h @@ -46,3 +46,4 @@ void MapAnimationInvalidateAll(); const std::vector& GetMapAnimations(); void MapAnimationAutoCreate(); void MapAnimationAutoCreateAtTileElement(TileCoordsXY coords, TileElement* el); +void ShiftAllMapAnimations(CoordsXY amount);