Skip unnecessary step after map init

There are no map animations to create on an empty map.
This commit is contained in:
Michael Steenbeek 2024-09-05 19:58:00 +02:00 committed by GitHub
parent b40990570f
commit 14f92966a6
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 3 additions and 2 deletions

View file

@ -462,7 +462,7 @@ void MapInit(const TileCoordsXY& size)
gameState.WidePathTileLoopPosition = {};
gameState.MapSize = size;
MapRemoveOutOfRangeElements();
MapAnimationAutoCreate();
ClearMapAnimations();
auto intent = Intent(INTENT_ACTION_MAP);
ContextBroadcastIntent(&intent);

View file

@ -601,7 +601,7 @@ const std::vector<MapAnimation>& GetMapAnimations()
return _mapAnimations;
}
static void ClearMapAnimations()
void ClearMapAnimations()
{
_mapAnimations.clear();
}

View file

@ -44,6 +44,7 @@ enum
void MapAnimationCreate(int32_t type, const CoordsXYZ& loc);
void MapAnimationInvalidateAll();
const std::vector<MapAnimation>& GetMapAnimations();
void ClearMapAnimations();
void MapAnimationAutoCreate();
void MapAnimationAutoCreateAtTileElement(TileCoordsXY coords, TileElement* el);
void ShiftAllMapAnimations(CoordsXY amount);