1
0
mirror of https://github.com/OpenRCT2/OpenRCT2 synced 2026-01-27 16:54:52 +01:00

Replace gCurrentTicks with the one in GameState_t

This commit is contained in:
ζeh Matt
2023-12-28 00:53:43 +02:00
parent 4c919f74aa
commit a5dde0f8dc
39 changed files with 259 additions and 146 deletions

View File

@@ -11,6 +11,7 @@
#include "../Context.h"
#include "../Game.h"
#include "../GameState.h"
#include "../entity/EntityList.h"
#include "../entity/Peep.h"
#include "../interface/Viewport.h"
@@ -28,6 +29,8 @@
#include "Map.h"
#include "Scenery.h"
using namespace OpenRCT2;
using map_animation_invalidate_event_handler = bool (*)(const CoordsXYZ& loc);
static std::vector<MapAnimation> _mapAnimations;
@@ -192,7 +195,7 @@ static bool MapAnimationInvalidateSmallScenery(const CoordsXYZ& loc)
if (sceneryEntry->HasFlag(SMALL_SCENERY_FLAG_IS_CLOCK))
{
// Peep, looking at scenery
if (!(gCurrentTicks & 0x3FF) && GameIsNotPaused())
if (!(GetGameState().CurrentTicks & 0x3FF) && GameIsNotPaused())
{
int32_t direction = tileElement->GetDirection();
auto quad = EntityTileList<Peep>(CoordsXY{ loc } - CoordsDirectionDelta[direction]);
@@ -480,7 +483,7 @@ static bool MapAnimationInvalidateWallDoor(const CoordsXYZ& loc)
TileCoordsXYZ tileLoc{ loc };
TileElement* tileElement;
if (gCurrentTicks & 1)
if (GetGameState().CurrentTicks & 1)
return false;
bool removeAnimation = true;