DarkflameServer/dScripts/02_server/Map/AM/AmBridge.cpp
Aaron Kimbrell 15954413ae
chore: rename rebuild to quickbuild (#1364)
* rename rebuild to quickbuild

* fix includes
2023-12-28 22:24:30 -06:00

29 lines
635 B
C++

#include "AmBridge.h"
#include "EntityManager.h"
void AmBridge::OnStartup(Entity* self) {
}
void AmBridge::OnQuickBuildComplete(Entity* self, Entity* target) {
const auto consoles = Game::entityManager->GetEntitiesInGroup("Console" + GeneralUtils::UTF16ToWTF8(self->GetVar<std::u16string>(u"bridge")));
if (consoles.empty()) {
return;
}
auto* console = consoles[0];
console->NotifyObject(self, "BridgeBuilt");
self->AddTimer("SmashBridge", 50);
}
void AmBridge::OnTimerDone(Entity* self, std::string timerName) {
if (timerName != "SmashBridge") {
return;
}
self->Smash(self->GetObjectID(), eKillType::VIOLENT);
}