Conflicts:
	src/server/game/Entities/Unit/Unit.cpp
This commit is contained in:
QAston
2011-07-13 17:22:04 +02:00
4 changed files with 716 additions and 729 deletions
File diff suppressed because it is too large Load Diff
@@ -200,7 +200,10 @@ void ObjectAccessor::RemoveCorpse(Corpse* corpse)
ASSERT(corpse && corpse->GetType() != CORPSE_BONES);
if (corpse->FindMap())
{
corpse->DestroyForNearbyPlayers();
corpse->FindMap()->Remove(corpse, false);
}
else
corpse->RemoveFromWorld();
@@ -824,20 +824,19 @@ namespace Trinity
class AnyUnfriendlyAttackableVisibleUnitInObjectRangeCheck
{
public:
AnyUnfriendlyAttackableVisibleUnitInObjectRangeCheck(WorldObject const* obj, Unit const* funit, float range)
: i_obj(obj), i_funit(funit), i_range(range) {}
AnyUnfriendlyAttackableVisibleUnitInObjectRangeCheck(Unit const* funit, float range)
: i_funit(funit), i_range(range) {}
bool operator()(Unit* u)
bool operator()(const Unit* u)
{
return u->isAlive()
&& i_obj->IsWithinDistInMap(u, i_range)
&& i_funit->IsWithinDistInMap(u, i_range)
&& !i_funit->IsFriendlyTo(u)
&& i_funit->canAttack(u)
&& u->GetCreatureType() != CREATURE_TYPE_CRITTER
&& i_funit->canSeeOrDetect(u);
}
private:
WorldObject const* i_obj;
Unit const* i_funit;
float i_range;
};
@@ -5686,7 +5686,7 @@ void AuraEffect::HandlePeriodicDummyAuraTick(Unit* target, Unit* caster) const
Cell cell(p);
cell.data.Part.reserved = ALL_DISTRICT;
Trinity::AnyUnfriendlyAttackableVisibleUnitInObjectRangeCheck u_check(target, target, radius);
Trinity::AnyUnfriendlyAttackableVisibleUnitInObjectRangeCheck u_check(target, radius);
Trinity::UnitListSearcher<Trinity::AnyUnfriendlyAttackableVisibleUnitInObjectRangeCheck> checker(target, targets, u_check);
TypeContainerVisitor<Trinity::UnitListSearcher<Trinity::AnyUnfriendlyAttackableVisibleUnitInObjectRangeCheck>, GridTypeMapContainer > grid_object_checker(checker);