[10197] Add to playercreateinfo original player orientation field.

It still not filled. Patch with correct values welcomed ;)
This commit is contained in:
VladimirMangos 2010-07-15 22:24:05 +04:00
parent e4495d4c2d
commit f8efc2b5b3
8 changed files with 27 additions and 17 deletions

View file

@ -24,7 +24,7 @@ CREATE TABLE `db_version` (
`version` varchar(120) default NULL, `version` varchar(120) default NULL,
`creature_ai_version` varchar(120) default NULL, `creature_ai_version` varchar(120) default NULL,
`cache_id` int(10) default '0', `cache_id` int(10) default '0',
`required_10171_01_mangos_mangos_string` bit(1) default NULL `required_10197_01_mangos_playercreateinfo` bit(1) default NULL
) ENGINE=MyISAM DEFAULT CHARSET=utf8 ROW_FORMAT=FIXED COMMENT='Used DB version notes'; ) ENGINE=MyISAM DEFAULT CHARSET=utf8 ROW_FORMAT=FIXED COMMENT='Used DB version notes';
-- --
@ -10216,6 +10216,7 @@ CREATE TABLE `playercreateinfo` (
`position_x` float NOT NULL default '0', `position_x` float NOT NULL default '0',
`position_y` float NOT NULL default '0', `position_y` float NOT NULL default '0',
`position_z` float NOT NULL default '0', `position_z` float NOT NULL default '0',
`orientation` float NOT NULL default '0',
PRIMARY KEY (`race`,`class`) PRIMARY KEY (`race`,`class`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8; ) ENGINE=MyISAM DEFAULT CHARSET=utf8;

View file

@ -0,0 +1,4 @@
ALTER TABLE db_version CHANGE COLUMN required_10171_01_mangos_mangos_string required_10197_01_mangos_playercreateinfo bit;
ALTER TABLE playercreateinfo
ADD COLUMN orientation float NOT NULL default '0' AFTER position_z;

View file

@ -106,6 +106,7 @@ pkgdata_DATA = \
10160_01_characters_character_aura.sql \ 10160_01_characters_character_aura.sql \
10160_02_characters_pet_aura.sql \ 10160_02_characters_pet_aura.sql \
10171_01_mangos_mangos_string.sql \ 10171_01_mangos_mangos_string.sql \
10197_01_mangos_playercreateinfo.sql \
README README
## Additional files to include when running 'make dist' ## Additional files to include when running 'make dist'
@ -192,4 +193,5 @@ EXTRA_DIST = \
10160_01_characters_character_aura.sql \ 10160_01_characters_character_aura.sql \
10160_02_characters_pet_aura.sql \ 10160_02_characters_pet_aura.sql \
10171_01_mangos_mangos_string.sql \ 10171_01_mangos_mangos_string.sql \
10197_01_mangos_playercreateinfo.sql \
README README

View file

@ -2467,7 +2467,7 @@ void ObjectMgr::LoadPlayerInfo()
// Load playercreate // Load playercreate
{ {
// 0 1 2 3 4 5 6 // 0 1 2 3 4 5 6
QueryResult *result = WorldDatabase.Query("SELECT race, class, map, zone, position_x, position_y, position_z FROM playercreateinfo"); QueryResult *result = WorldDatabase.Query("SELECT race, class, map, zone, position_x, position_y, position_z, orientation FROM playercreateinfo");
uint32 count = 0; uint32 count = 0;
@ -2488,13 +2488,14 @@ void ObjectMgr::LoadPlayerInfo()
{ {
Field* fields = result->Fetch(); Field* fields = result->Fetch();
uint32 current_race = fields[0].GetUInt32(); uint32 current_race = fields[0].GetUInt32();
uint32 current_class = fields[1].GetUInt32(); uint32 current_class = fields[1].GetUInt32();
uint32 mapId = fields[2].GetUInt32(); uint32 mapId = fields[2].GetUInt32();
uint32 areaId = fields[3].GetUInt32(); uint32 areaId = fields[3].GetUInt32();
float positionX = fields[4].GetFloat(); float positionX = fields[4].GetFloat();
float positionY = fields[5].GetFloat(); float positionY = fields[5].GetFloat();
float positionZ = fields[6].GetFloat(); float positionZ = fields[6].GetFloat();
float orientation = fields[7].GetFloat();
if(current_race >= MAX_RACES) if(current_race >= MAX_RACES)
{ {
@ -2522,7 +2523,7 @@ void ObjectMgr::LoadPlayerInfo()
} }
// accept DB data only for valid position (and non instanceable) // 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); sLog.outErrorDb("Wrong home position for class %u race %u pair in `playercreateinfo` table, ignoring.",current_class,current_race);
continue; continue;
@ -2536,11 +2537,12 @@ void ObjectMgr::LoadPlayerInfo()
PlayerInfo* pInfo = &playerInfo[current_race][current_class]; PlayerInfo* pInfo = &playerInfo[current_race][current_class];
pInfo->mapId = mapId; pInfo->mapId = mapId;
pInfo->areaId = areaId; pInfo->areaId = areaId;
pInfo->positionX = positionX; pInfo->positionX = positionX;
pInfo->positionY = positionY; pInfo->positionY = positionY;
pInfo->positionZ = positionZ; pInfo->positionZ = positionZ;
pInfo->orientation = orientation;
pInfo->displayId_m = rEntry->model_m; pInfo->displayId_m = rEntry->model_m;
pInfo->displayId_f = rEntry->model_f; pInfo->displayId_f = rEntry->model_f;

View file

@ -668,7 +668,7 @@ bool Player::Create( uint32 guidlow, const std::string& name, uint8 race, uint8
m_items[i] = NULL; m_items[i] = NULL;
SetLocationMapId(info->mapId); SetLocationMapId(info->mapId);
Relocate(info->positionX,info->positionY,info->positionZ); Relocate(info->positionX,info->positionY,info->positionZ, info->orientation);
ChrClassesEntry const* cEntry = sChrClassesStore.LookupEntry(class_); ChrClassesEntry const* cEntry = sChrClassesStore.LookupEntry(class_);
if(!cEntry) if(!cEntry)

View file

@ -310,6 +310,7 @@ struct PlayerInfo
float positionX; float positionX;
float positionY; float positionY;
float positionZ; float positionZ;
float orientation;
uint16 displayId_m; uint16 displayId_m;
uint16 displayId_f; uint16 displayId_f;
PlayerCreateInfoItems item; PlayerCreateInfoItems item;

View file

@ -1,4 +1,4 @@
#ifndef __REVISION_NR_H__ #ifndef __REVISION_NR_H__
#define __REVISION_NR_H__ #define __REVISION_NR_H__
#define REVISION_NR "10196" #define REVISION_NR "10197"
#endif // __REVISION_NR_H__ #endif // __REVISION_NR_H__

View file

@ -1,6 +1,6 @@
#ifndef __REVISION_SQL_H__ #ifndef __REVISION_SQL_H__
#define __REVISION_SQL_H__ #define __REVISION_SQL_H__
#define REVISION_DB_CHARACTERS "required_10160_02_characters_pet_aura" #define REVISION_DB_CHARACTERS "required_10160_02_characters_pet_aura"
#define REVISION_DB_MANGOS "required_10171_01_mangos_mangos_string" #define REVISION_DB_MANGOS "required_10197_01_mangos_playercreateinfo"
#define REVISION_DB_REALMD "required_10008_01_realmd_realmd_db_version" #define REVISION_DB_REALMD "required_10008_01_realmd_realmd_db_version"
#endif // __REVISION_SQL_H__ #endif // __REVISION_SQL_H__