add erase var helper for entity

This commit is contained in:
David Markowitz 2024-05-21 04:06:16 -07:00
parent abd978c348
commit 82507e642a
2 changed files with 10 additions and 0 deletions

View File

@ -2166,3 +2166,12 @@ void Entity::SetRespawnRot(const NiQuaternion& rotation) {
auto* characterComponent = GetComponent<CharacterComponent>();
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;
}
}
}

View File

@ -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;