mirror of
https://github.com/mangosfour/server.git
synced 2025-12-18 01:37:01 +00:00
[10111] Move code for initialize player model data and scale to same function, InitDisplayIds
Signed-off-by: NoFantasy <nofantasy@nf.no>
This commit is contained in:
parent
2375a1cb71
commit
0757b43929
2 changed files with 18 additions and 30 deletions
|
|
@ -687,19 +687,7 @@ bool Player::Create( uint32 guidlow, const std::string& name, uint8 race, uint8
|
||||||
|
|
||||||
SetUInt32Value(UNIT_FIELD_BYTES_0, ( RaceClassGender | ( powertype << 24 ) ) );
|
SetUInt32Value(UNIT_FIELD_BYTES_0, ( RaceClassGender | ( powertype << 24 ) ) );
|
||||||
|
|
||||||
InitDisplayIds();
|
InitDisplayIds(); // model, scale and model data
|
||||||
|
|
||||||
if (CreatureModelInfo const* modelInfo = sObjectMgr.GetCreatureModelInfo(GetDisplayId()))
|
|
||||||
{
|
|
||||||
// bounding_radius and combat_reach is normally modified by scale, but player is always 1.0 scale by default so no need to modify values here.
|
|
||||||
SetFloatValue(UNIT_FIELD_BOUNDINGRADIUS, modelInfo->bounding_radius);
|
|
||||||
SetFloatValue(UNIT_FIELD_COMBATREACH, modelInfo->combat_reach);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
SetFloatValue(UNIT_FIELD_BOUNDINGRADIUS, DEFAULT_WORLD_OBJECT_SIZE);
|
|
||||||
SetFloatValue(UNIT_FIELD_COMBATREACH, 1.5f);
|
|
||||||
}
|
|
||||||
|
|
||||||
SetByteFlag(UNIT_FIELD_BYTES_2, 1, UNIT_BYTE2_FLAG_PVP );
|
SetByteFlag(UNIT_FIELD_BYTES_2, 1, UNIT_BYTE2_FLAG_PVP );
|
||||||
SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_PVP_ATTACKABLE );
|
SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_PVP_ATTACKABLE );
|
||||||
|
|
@ -2704,9 +2692,6 @@ void Player::InitStatsForLevel(bool reapplyMods)
|
||||||
// set default cast time multiplier
|
// set default cast time multiplier
|
||||||
SetFloatValue(UNIT_MOD_CAST_SPEED, 1.0f);
|
SetFloatValue(UNIT_MOD_CAST_SPEED, 1.0f);
|
||||||
|
|
||||||
// reset scale before reapply auras
|
|
||||||
SetObjectScale(DEFAULT_OBJECT_SCALE);
|
|
||||||
|
|
||||||
// save base values (bonuses already included in stored stats
|
// save base values (bonuses already included in stored stats
|
||||||
for(int i = STAT_STRENGTH; i < MAX_STATS; ++i)
|
for(int i = STAT_STRENGTH; i < MAX_STATS; ++i)
|
||||||
SetCreateStat(Stats(i), info.stats[i]);
|
SetCreateStat(Stats(i), info.stats[i]);
|
||||||
|
|
@ -15004,19 +14989,7 @@ bool Player::LoadFromDB( uint32 guid, SqlQueryHolder *holder )
|
||||||
_LoadIntoDataField(fields[60].GetString(), PLAYER_EXPLORED_ZONES_1, PLAYER_EXPLORED_ZONES_SIZE);
|
_LoadIntoDataField(fields[60].GetString(), PLAYER_EXPLORED_ZONES_1, PLAYER_EXPLORED_ZONES_SIZE);
|
||||||
_LoadIntoDataField(fields[63].GetString(), PLAYER__FIELD_KNOWN_TITLES, KNOWN_TITLES_SIZE*2);
|
_LoadIntoDataField(fields[63].GetString(), PLAYER__FIELD_KNOWN_TITLES, KNOWN_TITLES_SIZE*2);
|
||||||
|
|
||||||
InitDisplayIds();
|
InitDisplayIds(); // model, scale and model data
|
||||||
|
|
||||||
if (CreatureModelInfo const* modelInfo = sObjectMgr.GetCreatureModelInfo(GetDisplayId()))
|
|
||||||
{
|
|
||||||
// bounding_radius and combat_reach is normally modified by scale, but player is always 1.0 scale by default so no need to modify values here.
|
|
||||||
SetFloatValue(UNIT_FIELD_BOUNDINGRADIUS, modelInfo->bounding_radius);
|
|
||||||
SetFloatValue(UNIT_FIELD_COMBATREACH, modelInfo->combat_reach);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
SetFloatValue(UNIT_FIELD_BOUNDINGRADIUS, DEFAULT_WORLD_OBJECT_SIZE);
|
|
||||||
SetFloatValue(UNIT_FIELD_COMBATREACH, 1.5f);
|
|
||||||
}
|
|
||||||
|
|
||||||
SetFloatValue(UNIT_FIELD_HOVERHEIGHT, 1.0f);
|
SetFloatValue(UNIT_FIELD_HOVERHEIGHT, 1.0f);
|
||||||
|
|
||||||
|
|
@ -18458,6 +18431,21 @@ void Player::InitDisplayIds()
|
||||||
sLog.outError("Invalid gender %u for player",gender);
|
sLog.outError("Invalid gender %u for player",gender);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// reset scale before reapply auras
|
||||||
|
SetObjectScale(DEFAULT_OBJECT_SCALE);
|
||||||
|
|
||||||
|
if (CreatureModelInfo const* modelInfo = sObjectMgr.GetCreatureModelInfo(GetDisplayId()))
|
||||||
|
{
|
||||||
|
// bounding_radius and combat_reach is normally modified by scale, but player is always 1.0 scale by default so no need to modify values here.
|
||||||
|
SetFloatValue(UNIT_FIELD_BOUNDINGRADIUS, modelInfo->bounding_radius);
|
||||||
|
SetFloatValue(UNIT_FIELD_COMBATREACH, modelInfo->combat_reach);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
SetFloatValue(UNIT_FIELD_BOUNDINGRADIUS, DEFAULT_WORLD_OBJECT_SIZE);
|
||||||
|
SetFloatValue(UNIT_FIELD_COMBATREACH, 1.5f);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Return true is the bought item has a max count to force refresh of window by caller
|
// Return true is the bought item has a max count to force refresh of window by caller
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
#ifndef __REVISION_NR_H__
|
#ifndef __REVISION_NR_H__
|
||||||
#define __REVISION_NR_H__
|
#define __REVISION_NR_H__
|
||||||
#define REVISION_NR "10110"
|
#define REVISION_NR "10111"
|
||||||
#endif // __REVISION_NR_H__
|
#endif // __REVISION_NR_H__
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue