aboutsummaryrefslogtreecommitdiff
path: root/src/server/game/Entities/Object
diff options
context:
space:
mode:
authorShauren <shauren.trinity@gmail.com>2012-12-31 20:43:14 +0100
committerShauren <shauren.trinity@gmail.com>2012-12-31 20:43:14 +0100
commitf1170ba0fb00c32d55bc7db0c0a2bae2aef2ec82 (patch)
tree30449c7ad27c0c4c064adbf91404964ccba2eed5 /src/server/game/Entities/Object
parentb229f72bf44e5d4a8abb02efe454348670122271 (diff)
Core: Fixed some level 4 warnings (msvc)
Diffstat (limited to 'src/server/game/Entities/Object')
-rw-r--r--src/server/game/Entities/Object/Object.cpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/server/game/Entities/Object/Object.cpp b/src/server/game/Entities/Object/Object.cpp
index 705360ec32a..27b9f33cccc 100644
--- a/src/server/game/Entities/Object/Object.cpp
+++ b/src/server/game/Entities/Object/Object.cpp
@@ -2380,6 +2380,7 @@ GameObject* WorldObject::SummonGameObject(uint32 entry, float x, float y, float
sLog->outError(LOG_FILTER_SQL, "Gameobject template %u not found in database!", entry);
return NULL;
}
+
Map* map = GetMap();
GameObject* go = new GameObject();
if (!go->Create(sObjectMgr->GenerateLowGuid(HIGHGUID_GAMEOBJECT), entry, map, GetPhaseMask(), x, y, z, ang, rotation0, rotation1, rotation2, rotation3, 100, GO_STATE_READY))
@@ -2387,13 +2388,14 @@ GameObject* WorldObject::SummonGameObject(uint32 entry, float x, float y, float
delete go;
return NULL;
}
+
go->SetRespawnTime(respawnTime);
if (GetTypeId() == TYPEID_PLAYER || GetTypeId() == TYPEID_UNIT) //not sure how to handle this
- ((Unit*)this)->AddGameObject(go);
+ ToUnit()->AddGameObject(go);
else
go->SetSpawnedByDefault(false);
- map->AddToMap(go);
+ map->AddToMap(go);
return go;
}