mirror of
https://github.com/DarkflameUniverse/DarkflameServer.git
synced 2025-08-04 09:44:10 +00:00
chore: rename rebuild to quickbuild (#1364)
* rename rebuild to quickbuild * fix includes
This commit is contained in:
@@ -1,13 +1,13 @@
|
||||
#include "NjRailActivatorsServer.h"
|
||||
#include "RebuildComponent.h"
|
||||
#include "QuickBuildComponent.h"
|
||||
#include "Character.h"
|
||||
|
||||
void NjRailActivatorsServer::OnUse(Entity* self, Entity* user) {
|
||||
const auto flag = self->GetVar<int32_t>(u"RailFlagNum");
|
||||
auto* rebuildComponent = self->GetComponent<RebuildComponent>();
|
||||
auto* quickBuildComponent = self->GetComponent<QuickBuildComponent>();
|
||||
|
||||
// Only allow use if this is not a quick build or the quick build is built
|
||||
if (rebuildComponent == nullptr || rebuildComponent->GetState() == eRebuildState::COMPLETED) {
|
||||
if (quickBuildComponent == nullptr || quickBuildComponent->GetState() == eQuickBuildState::COMPLETED) {
|
||||
auto* character = user->GetCharacter();
|
||||
if (character != nullptr) {
|
||||
character->SetPlayerFlag(flag, true);
|
||||
|
@@ -1,10 +1,10 @@
|
||||
#include "NjRailPostServer.h"
|
||||
#include "RebuildComponent.h"
|
||||
#include "QuickBuildComponent.h"
|
||||
#include "EntityManager.h"
|
||||
|
||||
void NjRailPostServer::OnStartup(Entity* self) {
|
||||
auto* rebuildComponent = self->GetComponent<RebuildComponent>();
|
||||
if (rebuildComponent != nullptr) {
|
||||
auto* quickBuildComponent = self->GetComponent<QuickBuildComponent>();
|
||||
if (quickBuildComponent != nullptr) {
|
||||
self->SetNetworkVar<bool>(NetworkNotActiveVariable, true);
|
||||
}
|
||||
}
|
||||
@@ -18,8 +18,8 @@ void NjRailPostServer::OnNotifyObject(Entity* self, Entity* sender, const std::s
|
||||
}
|
||||
}
|
||||
|
||||
void NjRailPostServer::OnRebuildNotifyState(Entity* self, eRebuildState state) {
|
||||
if (state == eRebuildState::COMPLETED) {
|
||||
void NjRailPostServer::OnQuickBuildNotifyState(Entity* self, eQuickBuildState state) {
|
||||
if (state == eQuickBuildState::COMPLETED) {
|
||||
auto* relatedRail = GetRelatedRail(self);
|
||||
if (relatedRail == nullptr)
|
||||
return;
|
||||
@@ -30,7 +30,7 @@ void NjRailPostServer::OnRebuildNotifyState(Entity* self, eRebuildState state) {
|
||||
return;
|
||||
|
||||
self->SetNetworkVar(NetworkNotActiveVariable, false);
|
||||
} else if (state == eRebuildState::RESETTING) {
|
||||
} else if (state == eQuickBuildState::RESETTING) {
|
||||
auto* relatedRail = GetRelatedRail(self);
|
||||
if (relatedRail == nullptr)
|
||||
return;
|
||||
|
@@ -4,7 +4,7 @@
|
||||
class NjRailPostServer : public CppScripts::Script {
|
||||
void OnStartup(Entity* self) override;
|
||||
void OnNotifyObject(Entity* self, Entity* sender, const std::string& name, int32_t param1, int32_t param2) override;
|
||||
void OnRebuildNotifyState(Entity* self, eRebuildState state) override;
|
||||
void OnQuickBuildNotifyState(Entity* self, eQuickBuildState state) override;
|
||||
private:
|
||||
Entity* GetRelatedRail(Entity* self);
|
||||
const std::u16string NetworkNotActiveVariable = u"NetworkNotActive";
|
||||
|
@@ -11,7 +11,7 @@ void PropertyDevice::OnStartup(Entity* self) {
|
||||
}
|
||||
}
|
||||
|
||||
void PropertyDevice::OnRebuildComplete(Entity* self, Entity* target) {
|
||||
void PropertyDevice::OnQuickBuildComplete(Entity* self, Entity* target) {
|
||||
auto propertyOwnerID = self->GetNetworkVar<std::string>(m_PropertyOwnerVariable);
|
||||
if (propertyOwnerID == std::to_string(LWOOBJID_EMPTY))
|
||||
return;
|
||||
|
@@ -3,7 +3,7 @@
|
||||
|
||||
class PropertyDevice : public CppScripts::Script {
|
||||
void OnStartup(Entity* self) override;
|
||||
void OnRebuildComplete(Entity* self, Entity* target) override;
|
||||
void OnQuickBuildComplete(Entity* self, Entity* target) override;
|
||||
const std::u16string m_PropertyOwnerVariable = u"PropertyOwnerID";
|
||||
const uint32_t m_PropertyMissionID = 1291;
|
||||
};
|
||||
|
@@ -1,9 +1,9 @@
|
||||
#include "PropertyPlatform.h"
|
||||
#include "RebuildComponent.h"
|
||||
#include "QuickBuildComponent.h"
|
||||
#include "GameMessages.h"
|
||||
#include "MovingPlatformComponent.h"
|
||||
|
||||
void PropertyPlatform::OnRebuildComplete(Entity* self, Entity* target) {
|
||||
void PropertyPlatform::OnQuickBuildComplete(Entity* self, Entity* target) {
|
||||
// auto* movingPlatform = self->GetComponent<MovingPlatformComponent>();
|
||||
// if (movingPlatform != nullptr) {
|
||||
// movingPlatform->StopPathing();
|
||||
@@ -14,8 +14,8 @@ void PropertyPlatform::OnRebuildComplete(Entity* self, Entity* target) {
|
||||
}
|
||||
|
||||
void PropertyPlatform::OnUse(Entity* self, Entity* user) {
|
||||
auto* rebuildComponent = self->GetComponent<RebuildComponent>();
|
||||
if (rebuildComponent != nullptr && rebuildComponent->GetState() == eRebuildState::COMPLETED) {
|
||||
auto* quickBuildComponent = self->GetComponent<QuickBuildComponent>();
|
||||
if (quickBuildComponent != nullptr && quickBuildComponent->GetState() == eQuickBuildState::COMPLETED) {
|
||||
// auto* movingPlatform = self->GetComponent<MovingPlatformComponent>();
|
||||
// if (movingPlatform != nullptr) {
|
||||
// movingPlatform->GotoWaypoint(1);
|
||||
|
@@ -4,7 +4,7 @@
|
||||
class PropertyPlatform : public CppScripts::Script {
|
||||
public:
|
||||
void OnUse(Entity* self, Entity* user) override;
|
||||
void OnRebuildComplete(Entity* self, Entity* target) override;
|
||||
void OnQuickBuildComplete(Entity* self, Entity* target) override;
|
||||
private:
|
||||
float_t movementDelay = 10.0f;
|
||||
float_t effectDelay = 5.0f;
|
||||
|
@@ -6,7 +6,7 @@
|
||||
#include "CDObjectSkillsTable.h"
|
||||
#include "CDSkillBehaviorTable.h"
|
||||
|
||||
void QbEnemyStunner::OnRebuildComplete(Entity* self, Entity* target) {
|
||||
void QbEnemyStunner::OnQuickBuildComplete(Entity* self, Entity* target) {
|
||||
auto* destroyable = self->GetComponent<DestroyableComponent>();
|
||||
|
||||
if (destroyable != nullptr) {
|
||||
|
@@ -4,6 +4,6 @@
|
||||
class QbEnemyStunner : public CppScripts::Script
|
||||
{
|
||||
public:
|
||||
void OnRebuildComplete(Entity* self, Entity* target) override;
|
||||
void OnQuickBuildComplete(Entity* self, Entity* target) override;
|
||||
void OnTimerDone(Entity* self, std::string timerName) override;
|
||||
};
|
||||
|
Reference in New Issue
Block a user