Cleanup and reorganization of Unit and SpellEntry headers. (#312)

* Move some unit and spell defines to dedicated header.

* Reorder functions in unit header.

* Clean up until spell category.

* Finish cleaning up spell functions.

* Cleanup combat system methods.

* Done cleaning up unit header.

* Reduce not needed includes.
This commit is contained in:
ratkosrb
2019-11-24 22:20:44 +02:00
committed by GitHub
parent df76eff1d3
commit 66659fe13f
374 changed files with 7116 additions and 7379 deletions
+15 -5
View File
@@ -157,14 +157,14 @@ Unit* DynamicObject::GetUnitCaster() const
return nullptr;
}
uint32 DynamicObject::getFaction() const
uint32 DynamicObject::GetFactionTemplateId() const
{
return GetCaster()->getFaction();
return GetCaster()->GetFactionTemplateId();
}
uint32 DynamicObject::getLevel() const
uint32 DynamicObject::GetLevel() const
{
return GetCaster()->getLevel();
return GetCaster()->GetLevel();
}
void DynamicObject::Update(uint32 update_diff, uint32 p_time)
@@ -228,6 +228,16 @@ void DynamicObject::Delete()
AddObjectToRemoveList();
}
void DynamicObject::AddAffected(Unit* unit)
{
m_affected[unit->GetObjectGuid()] = 0;
}
void DynamicObject::RemoveAffected(Unit* unit)
{
m_affected.erase(unit->GetObjectGuid());
}
void DynamicObject::Delay(int32 delaytime)
{
m_aliveDuration -= delaytime;
@@ -267,7 +277,7 @@ void DynamicObject::Delay(int32 delaytime)
}
}
bool DynamicObject::isVisibleForInState(WorldObject const* pDetector, WorldObject const* viewPoint, bool inVisibleList) const
bool DynamicObject::IsVisibleForInState(WorldObject const* pDetector, WorldObject const* viewPoint, bool inVisibleList) const
{
if (!IsInWorld() || !pDetector->IsInWorld())
return false;