Use compile-time flag setting

This commit is contained in:
jadebenn
2024-04-20 14:17:34 -05:00
parent 5ddf4ce28b
commit f41321eb7b
7 changed files with 196 additions and 64 deletions

View File

@@ -77,10 +77,10 @@ void DamagingPets::MakeUntamable(Entity* self) {
auto* const petComponent = self->GetComponent<PetComponent>();
// If the pet is currently not being tamed, make it hostile
if (petComponent != nullptr && !petComponent->m_Flags.Has(PetFlag::NOT_WAITING)) {
if (petComponent != nullptr && !petComponent->m_Flags.Has<PetFlag::NOT_WAITING>()) {
self->SetNetworkVar<bool>(u"bIAmTamable", false);
self->SetVar<bool>(u"IsEvil", true);
petComponent->m_Flags.Set(PetFlag::IDLE);
petComponent->m_Flags.Set<PetFlag::IDLE>();
auto* combatAIComponent = self->GetComponent<BaseCombatAIComponent>();
if (combatAIComponent != nullptr) {
@@ -110,7 +110,7 @@ void DamagingPets::ClearEffects(Entity* self) {
auto* petComponent = self->GetComponent<PetComponent>();
if (petComponent != nullptr) {
petComponent->m_Flags.Set(PetFlag::TAMEABLE, PetFlag::UNKNOWN2);
petComponent->m_Flags.Set<PetFlag::TAMEABLE, PetFlag::UNKNOWN2>();
}
auto* combatAIComponent = self->GetComponent<BaseCombatAIComponent>();