diff --git a/dGame/Entity.cpp b/dGame/Entity.cpp index 6d0014bf..715e9231 100644 --- a/dGame/Entity.cpp +++ b/dGame/Entity.cpp @@ -2166,3 +2166,12 @@ void Entity::SetRespawnRot(const NiQuaternion& rotation) { auto* characterComponent = GetComponent(); if (characterComponent) characterComponent->SetRespawnRot(rotation); } + +void Entity::EraseVar(const std::u16string& name) { + for (auto it = m_Settings.begin(); it != m_Settings.end(); ++it) { + if ((*it)->GetKey() == name) { + m_Settings.erase(it); + return; + } + } +} diff --git a/dGame/Entity.h b/dGame/Entity.h index ffdcb713..278d81b0 100644 --- a/dGame/Entity.h +++ b/dGame/Entity.h @@ -299,6 +299,7 @@ public: // Scale will only be communicated to the client when the construction packet is sent void SetScale(const float scale) { m_Scale = scale; }; + void EraseVar(const std::u16string& name); protected: LWOOBJID m_ObjectID;