Add comments, remove dead code etc.

This commit is contained in:
David Markowitz
2025-04-03 00:15:15 -07:00
parent a909546e2f
commit e96eed5316
9 changed files with 42 additions and 37 deletions

View File

@@ -10,6 +10,7 @@
#include "SimplePhysicsComponent.h"
#include "Database.h"
#include "DluAssert.h"
ModelComponent::ModelComponent(Entity* parent) : Component(parent) {
m_OriginalPosition = m_Parent->GetDefaultPosition();
@@ -36,9 +37,14 @@ bool ModelComponent::OnResetModelToDefaults(GameMessages::GameMsg& msg) {
}
bool ModelComponent::OnRequestUse(GameMessages::GameMsg& msg) {
auto& requestUse = static_cast<GameMessages::RequestUse&>(msg);
for (auto& behavior : m_Behaviors) behavior.HandleMsg(requestUse);
return true;
bool toReturn = false;
if (!m_IsPaused) {
auto& requestUse = static_cast<GameMessages::RequestUse&>(msg);
for (auto& behavior : m_Behaviors) behavior.HandleMsg(requestUse);
toReturn = true;
}
return toReturn;
}
void ModelComponent::Update(float deltaTime) {

View File

@@ -127,10 +127,13 @@ public:
void Resume();
private:
// Whether or not this component needs to have its extra data serialized.
bool m_Dirty{};
// The number of strips listening for a RequestUse GM to come in.
uint32_t m_NumListeningInteract{};
// Whether or not the model is paused and should reject all interactions regarding behaviors.
bool m_IsPaused{};
/**
* The behaviors of the model

View File

@@ -221,8 +221,6 @@ bool PropertyManagementComponent::Claim(const LWOOBJID playerId) {
}
void PropertyManagementComponent::OnStartBuilding() {
m_IsBuilding = true;
auto* ownerEntity = GetOwner();
if (ownerEntity == nullptr) return;
@@ -270,8 +268,6 @@ void PropertyManagementComponent::OnStartBuilding() {
}
void PropertyManagementComponent::OnFinishBuilding() {
m_IsBuilding = false;
auto* ownerEntity = GetOwner();
if (ownerEntity == nullptr) return;

View File

@@ -239,6 +239,4 @@ private:
* The privacy setting before it was changed, saved to set back after a player finishes building
*/
PropertyPrivacyOption originalPrivacyOption = PropertyPrivacyOption::Private;
bool m_IsBuilding{};
};