*Add unit to notify when unit is add to world (including load grid case).

*Add some check in remove object function.

--HG--
branch : trunk
This commit is contained in:
megamage
2009-04-08 17:23:57 -05:00
parent 0c2dd85c2c
commit a7e04a252f
4 changed files with 18 additions and 9 deletions
+1 -1
View File
@@ -1216,7 +1216,7 @@ bool BattleGround::AddObject(uint32 type, uint32 entry, float x, float y, float
data.go_state = 1;
*/
// add to world, so it can be later looked up from HashMapHolder
go->AddToWorld();
map->Add(go);
m_BgObjects[type] = go->GetGUID();
return true;
}
+2 -2
View File
@@ -485,7 +485,7 @@ bool Map::Add(Player *player)
SendInitTransports(player);
player->m_clientGUIDs.clear();
AddNotifier(player);
//AddNotifier(player);
return true;
}
@@ -523,7 +523,7 @@ Map::Add(T *obj)
UpdateObjectVisibility(obj,cell,p);
AddNotifier(obj);
//AddNotifier(obj);
}
void Map::MessageBroadcast(Player *player, WorldPacket *msg, bool to_self, bool to_possessor)
+5 -1
View File
@@ -97,6 +97,8 @@ Object::~Object( )
//DEBUG_LOG("Object desctr 1 check (%p)",(void*)this);
delete [] m_uint32Values;
delete [] m_uint32Values_mirror;
m_uint32Values = NULL;
m_uint32Values_mirror = NULL;
//DEBUG_LOG("Object desctr 2 check (%p)",(void*)this);
}
}
@@ -1567,7 +1569,9 @@ Map const* WorldObject::GetBaseMap() const
void WorldObject::AddObjectToRemoveList()
{
Map* map = MapManager::Instance().FindMap(GetMapId(), GetInstanceId());
assert(m_uint32Values);
Map* map = FindMap();
if(!map)
{
sLog.outError("Object (TypeId: %u Entry: %u GUID: %u) at attempt add to move list not have valid map (Id: %u).",GetTypeId(),GetEntry(),GetGUIDLow(),GetMapId());
+10 -5
View File
@@ -66,11 +66,6 @@ float baseMoveSpeed[MAX_MOVE_TYPE] =
void InitTriggerAuraData();
void Unit::AddToWorld()
{
WorldObject::AddToWorld();
}
// auraTypes contains attacker auras capable of proc'ing cast auras
static Unit::AuraTypeSet GenerateAttakerProcCastAuraTypes()
{
@@ -10853,6 +10848,16 @@ uint32 Unit::GetCreatePowers( Powers power ) const
return 0;
}
void Unit::AddToWorld()
{
if(!IsInWorld())
{
m_Notified = false;
m_IsInNotifyList = false;
SetToNotify();
}
}
void Unit::RemoveFromWorld()
{
// cleanup