fix(njhub): Fire Temple rocks restart their timers as the Lua's AddTimerWithCancel

L_FIRE_TRANS_ROCKS and L_FIRE_TRANS_ROCKS_MANAGER use AddTimerWithCancel: a timer started again replaces the running
one instead of running twice.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Aaron Kimbrell
2026-11-29 00:38:38 -06:00
parent 641685f04a
commit 3c0858578f
2 changed files with 5 additions and 0 deletions

View File

@@ -10,6 +10,7 @@ void FireTransRocks::OnStartup(Entity* self) {
void FireTransRocks::OnArrivedAtDesiredWaypoint(Entity* self, const uint32_t waypointIndex) {
if (waypointIndex == 1) {
self->CancelTimer("PlatHold");
self->AddTimer("PlatHold", 3.5f);
return;
}

View File

@@ -7,6 +7,7 @@
#include "MovingPlatformComponent.h"
void FireTransRocksManager::OnStartup(Entity* self) {
self->CancelTimer("check");
self->AddTimer("check", 5.0f);
if (!self->HasVar(u"RockGroup")) self->SetVar<std::u16string>(u"RockGroup", u"FireTransRocks");
if (!self->HasVar(u"NumberOfRocks")) self->SetVar<int32_t>(u"NumberOfRocks", 3);
@@ -16,9 +17,11 @@ void FireTransRocksManager::CheckForRocks(Entity* self) {
const auto rocks = Game::entityManager->GetEntitiesInGroup(self->GetVarAsString(u"RockGroup"));
// Not all there yet: look again in a second
if (static_cast<int32_t>(rocks.size()) < self->GetVarAs<int32_t>(u"NumberOfRocks")) {
self->CancelTimer("check");
self->AddTimer("check", 1.0f);
return;
}
self->CancelTimer("StartPlatforms");
self->AddTimer("StartPlatforms", 5.0f);
}
@@ -32,6 +35,7 @@ void FireTransRocksManager::OnNotifyObject(Entity* self, Entity* sender, const s
return;
}
// All of them are down
self->CancelTimer("restartPlatforms");
self->AddTimer("restartPlatforms", 1.0f);
}