diff options
author | Brian <runningnak3d@gmail.com> | 2010-07-22 14:37:32 -0600 |
---|---|---|
committer | Brian <runningnak3d@gmail.com> | 2010-07-22 14:37:32 -0600 |
commit | 9ff821d8bb2ee4e3f43c43e3badbeb40e000d503 (patch) | |
tree | 8781f3dc7f54abc4fd733d81070b4f34d16c43f1 /src/server/game/Globals/ObjectMgr.cpp | |
parent | c8662c888b7b809189c3aedd2f4a7c0403f6456e (diff) |
* Add the ability to set player orientation for new characters.
* Requires DB data to actully do anything, however not needed for working
* server
* Original patch by Vladimir
--HG--
branch : trunk
Diffstat (limited to 'src/server/game/Globals/ObjectMgr.cpp')
-rw-r--r-- | src/server/game/Globals/ObjectMgr.cpp | 28 |
1 files changed, 15 insertions, 13 deletions
diff --git a/src/server/game/Globals/ObjectMgr.cpp b/src/server/game/Globals/ObjectMgr.cpp index 0a29026bd61..9997fcf865c 100644 --- a/src/server/game/Globals/ObjectMgr.cpp +++ b/src/server/game/Globals/ObjectMgr.cpp @@ -2729,7 +2729,7 @@ void ObjectMgr::LoadPlayerInfo() // Load playercreate { // 0 1 2 3 4 5 6 - QueryResult_AutoPtr result = WorldDatabase.Query("SELECT race, class, map, zone, position_x, position_y, position_z FROM playercreateinfo"); + QueryResult_AutoPtr result = WorldDatabase.Query("SELECT race, class, map, zone, position_x, position_y, position_z, orientation FROM playercreateinfo"); uint32 count = 0; @@ -2749,13 +2749,14 @@ void ObjectMgr::LoadPlayerInfo() { Field* fields = result->Fetch(); - uint32 current_race = fields[0].GetUInt32(); + uint32 current_race = fields[0].GetUInt32(); uint32 current_class = fields[1].GetUInt32(); - uint32 mapId = fields[2].GetUInt32(); - uint32 areaId = fields[3].GetUInt32(); - float positionX = fields[4].GetFloat(); - float positionY = fields[5].GetFloat(); - float positionZ = fields[6].GetFloat(); + uint32 mapId = fields[2].GetUInt32(); + uint32 areaId = fields[3].GetUInt32(); + float positionX = fields[4].GetFloat(); + float positionY = fields[5].GetFloat(); + float positionZ = fields[6].GetFloat(); + float orientation = fields[7].GetFloat(); if (current_race >= MAX_RACES) { @@ -2783,7 +2784,7 @@ void ObjectMgr::LoadPlayerInfo() } // accept DB data only for valid position (and non instanceable) - if (!MapManager::IsValidMapCoord(mapId,positionX,positionY,positionZ)) + if (!MapManager::IsValidMapCoord(mapId,positionX,positionY,positionZ,orientation)) { sLog.outErrorDb("Wrong home position for class %u race %u pair in `playercreateinfo` table, ignoring.",current_class,current_race); continue; @@ -2797,11 +2798,12 @@ void ObjectMgr::LoadPlayerInfo() PlayerInfo* pInfo = &playerInfo[current_race][current_class]; - pInfo->mapId = mapId; - pInfo->areaId = areaId; - pInfo->positionX = positionX; - pInfo->positionY = positionY; - pInfo->positionZ = positionZ; + pInfo->mapId = mapId; + pInfo->areaId = areaId; + pInfo->positionX = positionX; + pInfo->positionY = positionY; + pInfo->positionZ = positionZ; + pInfo->orientation = orientation; pInfo->displayId_m = rEntry->model_m; pInfo->displayId_f = rEntry->model_f; |