Core/Unit: Renamed addUnitState/hasUnitState/clearUnitState to AddUnitState/HasUnitState/ClearUnitState

Core/Vehicles: Allow the vehicle to always damage the passenger (removed unneded dbc hacks from scripts)

--HG--
branch : trunk
This commit is contained in:
Shauren
2010-12-17 13:43:24 +01:00
parent ee3fd3ebeb
commit 82f45966fc
99 changed files with 353 additions and 361 deletions
@@ -116,7 +116,7 @@ inline void CreatureUnitRelocationWorker(Creature* c, Unit* u)
if (!u->isAlive() || !c->isAlive() || c == u || u->isInFlight())
return;
if (c->HasReactState(REACT_AGGRESSIVE) && !c->hasUnitState(UNIT_STAT_SIGHTLESS))
if (c->HasReactState(REACT_AGGRESSIVE) && !c->HasUnitState(UNIT_STAT_SIGHTLESS))
if (c->IsAIEnabled && c->canSeeOrDetect(u, false, true))
c->AI()->MoveInLineOfSight_Safe(u);
}
@@ -735,7 +735,7 @@ namespace Trinity
bool operator()(Unit* u)
{
if (u->isAlive() && u->isInCombat() && !i_obj->IsHostileTo(u) && i_obj->IsWithinDistInMap(u, i_range) &&
(u->isFeared() || u->isCharmed() || u->isFrozen() || u->hasUnitState(UNIT_STAT_STUNNED) || u->hasUnitState(UNIT_STAT_CONFUSED)))
(u->isFeared() || u->isCharmed() || u->isFrozen() || u->HasUnitState(UNIT_STAT_STUNNED) || u->HasUnitState(UNIT_STAT_CONFUSED)))
{
return true;
}
+3 -3
View File
@@ -94,11 +94,11 @@ class ObjectWorldLoader
uint32 i_corpses;
};
template<class T> void addUnitState(T* /*obj*/, CellPair const& /*cell_pair*/)
template<class T> void AddUnitState(T* /*obj*/, CellPair const& /*cell_pair*/)
{
}
template<> void addUnitState(Creature *obj, CellPair const& cell_pair)
template<> void AddUnitState(Creature *obj, CellPair const& cell_pair)
{
Cell cell(cell_pair);
@@ -109,7 +109,7 @@ template <class T>
void AddObjectHelper(CellPair &cell, GridRefManager<T> &m, uint32 &count, Map* map, T *obj)
{
obj->GetGridRef().link(&m, obj);
addUnitState(obj,cell);
AddUnitState(obj,cell);
obj->AddToWorld();
if (obj->isActiveObject())
map->AddToActive(obj);