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

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

17 lines
592 B
C++

#include "NjRailActivatorsServer.h"
#include "QuickBuildComponent.h"
#include "Character.h"
void NjRailActivatorsServer::OnUse(Entity* self, Entity* user) {
const auto flag = self->GetVar<int32_t>(u"RailFlagNum");
auto* quickBuildComponent = self->GetComponent<QuickBuildComponent>();
// Only allow use if this is not a quick build or the quick build is built
if (quickBuildComponent == nullptr || quickBuildComponent->GetState() == eQuickBuildState::COMPLETED) {
auto* character = user->GetCharacter();
if (character != nullptr) {
character->SetPlayerFlag(flag, true);
}
}
}