diff options
author | megamage <none@none> | 2009-06-27 17:50:28 -0500 |
---|---|---|
committer | megamage <none@none> | 2009-06-27 17:50:28 -0500 |
commit | 7c8f37abeac9e0dee04ad76a38d668d702c023fd (patch) | |
tree | 5ed3421693b4b152acbd62f267d0fab95e38afe5 /src | |
parent | e5b982b0ef450033ccb58335906c360c79f9f523 (diff) |
[8078] Fixed typos in character data loading after recently added new field.
* Really use race/class/gender fields instead `data` field values.
* Load extra flags (gm mode onm gm fly mode, gm invisibility and etc) from proper field.
NOTE: recommedned reset characters.extra_flags field to 0 for all characters.
It can be corrupted in time login/logout before this fix.
Author: VladimirMangos
--HG--
branch : trunk
Diffstat (limited to 'src')
-rw-r--r-- | src/game/Player.cpp | 12 | ||||
-rw-r--r-- | src/game/World.cpp | 4 |
2 files changed, 9 insertions, 7 deletions
diff --git a/src/game/Player.cpp b/src/game/Player.cpp index c881c3c950c..634c30b805a 100644 --- a/src/game/Player.cpp +++ b/src/game/Player.cpp @@ -14382,9 +14382,11 @@ bool Player::LoadFromDB( uint32 guid, SqlQueryHolder *holder ) // overwrite some data fields uint32 bytes0 = GetUInt32Value(UNIT_FIELD_BYTES_0) & 0xFF000000; - bytes0 |= fields[4].GetUInt8(); - bytes0 |= fields[5].GetUInt8() << 8; - bytes0 |= fields[6].GetUInt8() << 16; + bytes0 |= fields[4].GetUInt8(); // race + bytes0 |= fields[5].GetUInt8() << 8; // class + bytes0 |= fields[6].GetUInt8() << 16; // gender + SetUInt32Value(UNIT_FIELD_BYTES_0, bytes0); + SetUInt32Value(UNIT_FIELD_LEVEL, fields[7].GetUInt8()); SetUInt32Value(PLAYER_XP, fields[8].GetUInt32()); SetUInt32Value(PLAYER_FIELD_COINAGE, fields[9].GetUInt32()); @@ -14687,7 +14689,7 @@ bool Player::LoadFromDB( uint32 guid, SqlQueryHolder *holder ) //speed collect rest bonus in offline, in logout, in tavern, city (section/in hour) float bubble1 = 0.125; - if((int32)fields[23].GetUInt32() > 0) + if(time_diff > 0) { float bubble = fields[24].GetUInt32() > 0 ? bubble1*sWorld.getRate(RATE_REST_OFFLINE_IN_TAVERN_OR_CITY) @@ -14711,7 +14713,7 @@ bool Player::LoadFromDB( uint32 guid, SqlQueryHolder *holder ) m_taxi.LoadTaxiMask( fields[18].GetString() ); // must be before InitTaxiNodesForLevel - uint32 extraflags = fields[25].GetUInt32(); + uint32 extraflags = fields[32].GetUInt32(); m_stableSlots = fields[33].GetUInt32(); if(m_stableSlots > MAX_PET_STABLES) diff --git a/src/game/World.cpp b/src/game/World.cpp index 608aaec01d5..e5b6c7e5280 100644 --- a/src/game/World.cpp +++ b/src/game/World.cpp @@ -2068,8 +2068,8 @@ void World::ScriptsProcess() sLog.outError("SCRIPT_COMMAND_MOVE_TO call for non-creature (TypeId: %u), skipping.",source->GetTypeId()); break; } - ((Unit *)source)->SendMonsterMoveWithSpeed(step.script->x, step.script->y, step.script->z, step.script->datalong2 ); - ((Unit *)source)->GetMap()->CreatureRelocation(((Creature *)source), step.script->x, step.script->y, step.script->z, 0); + ((Creature*)source)->SendMonsterMoveWithSpeed(step.script->x, step.script->y, step.script->z, step.script->datalong2 ); + ((Creature*)source)->GetMap()->CreatureRelocation(((Creature*)source), step.script->x, step.script->y, step.script->z, 0); break; case SCRIPT_COMMAND_FLAG_SET: if(!source) |