Also shift jumping fountains and map animations

This commit is contained in:
Gymnasiast 2024-03-31 00:32:36 +01:00
parent 4f41734dc5
commit 86f80faca8
No known key found for this signature in database
GPG Key ID: DBFFF47AB2CA3EDD
3 changed files with 24 additions and 0 deletions

View File

@ -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<JumpingFountain>();
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);
}

View File

@ -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;
}
}

View File

@ -46,3 +46,4 @@ void MapAnimationInvalidateAll();
const std::vector<MapAnimation>& GetMapAnimations();
void MapAnimationAutoCreate();
void MapAnimationAutoCreateAtTileElement(TileCoordsXY coords, TileElement* el);
void ShiftAllMapAnimations(CoordsXY amount);