Skip to content

Commit 88a9a1a

Browse files
committed
Core/Misc: Reduce differences between branches
1 parent 6522446 commit 88a9a1a

File tree

3 files changed

+20
-34
lines changed

3 files changed

+20
-34
lines changed

src/server/game/Entities/Player/Player.cpp

Lines changed: 16 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -497,9 +497,8 @@ bool Player::Create(ObjectGuid::LowType guidlow, CharacterCreateInfo* createInfo
497497
SetPvpFlag(UNIT_BYTE2_FLAG_PVP);
498498
SetUnitFlag(UNIT_FLAG_PLAYER_CONTROLLED);
499499
}
500+
500501
SetUnitFlag2(UNIT_FLAG2_REGENERATE_POWER);
501-
SetModCastingSpeed(1.0f); // fix cast time showed in spell tooltip on client
502-
SetHoverHeight(1.0f); // default for players in 3.0.3
503502

504503
SetInt32Value(PLAYER_FIELD_WATCHED_FACTION_INDEX, uint32(-1)); // -1 is default value
505504

@@ -510,37 +509,9 @@ bool Player::Create(ObjectGuid::LowType guidlow, CharacterCreateInfo* createInfo
510509
SetFacialStyle(createInfo->FacialHair);
511510
SetRestState((GetSession()->IsARecruiter() || GetSession()->GetRecruiterId() != 0) ? REST_STATE_RAF_LINKED : REST_STATE_NOT_RAF_LINKED);
512511
SetNativeGender(Gender(createInfo->Gender));
513-
SetArenaFaction(0);
514-
515-
SetUInt32Value(PLAYER_GUILDID, 0);
516-
SetGuildRank(0);
517-
SetUInt32Value(PLAYER_GUILD_TIMESTAMP, 0);
518-
519-
for (int i = 0; i < KNOWN_TITLES_SIZE; ++i)
520-
SetUInt64Value(PLAYER__FIELD_KNOWN_TITLES + i, 0); // 0=disabled
521-
SetUInt32Value(PLAYER_CHOSEN_TITLE, 0);
522-
523-
SetUInt32Value(PLAYER_FIELD_KILLS, 0);
524-
SetUInt32Value(PLAYER_FIELD_LIFETIME_HONORABLE_KILLS, 0);
525-
SetUInt32Value(PLAYER_FIELD_TODAY_CONTRIBUTION, 0);
526-
SetUInt32Value(PLAYER_FIELD_YESTERDAY_CONTRIBUTION, 0);
527512

528513
// set starting level
529-
uint32 start_level = GetClass() != CLASS_DEATH_KNIGHT
530-
? sWorld->getIntConfig(CONFIG_START_PLAYER_LEVEL)
531-
: sWorld->getIntConfig(CONFIG_START_DEATH_KNIGHT_PLAYER_LEVEL);
532-
533-
if (m_session->HasPermission(rbac::RBAC_PERM_USE_START_GM_LEVEL))
534-
{
535-
uint32 gm_level = GetClass() != CLASS_DEATH_KNIGHT
536-
? sWorld->getIntConfig(CONFIG_START_GM_LEVEL)
537-
: std::max(sWorld->getIntConfig(CONFIG_START_GM_LEVEL), sWorld->getIntConfig(CONFIG_START_DEATH_KNIGHT_PLAYER_LEVEL));
538-
539-
if (gm_level > start_level)
540-
start_level = gm_level;
541-
}
542-
543-
SetLevel(start_level, false);
514+
SetLevel(GetStartLevel(createInfo->Class), false);
544515

545516
InitRunes();
546517

@@ -2677,7 +2648,7 @@ void Player::InitStatsForLevel(bool reapplyMods)
26772648
{
26782649
SetInt32Value(PLAYER_FIELD_MOD_DAMAGE_DONE_NEG + i, 0);
26792650
SetInt32Value(PLAYER_FIELD_MOD_DAMAGE_DONE_POS + i, 0);
2680-
SetFloatValue(PLAYER_FIELD_MOD_DAMAGE_DONE_PCT + i, 1.00f);
2651+
SetFloatValue(PLAYER_FIELD_MOD_DAMAGE_DONE_PCT + i, 1.0f);
26812652
}
26822653

26832654
//reset attack power, damage and attack speed fields
@@ -11296,7 +11267,6 @@ InventoryResult Player::CanEquipItem(uint8 slot, uint16 &dest, Item* pItem, bool
1129611267
// Do not allow polearm to be equipped in the offhand (rare case for the only 1h polearm 41750)
1129711268
if (type == INVTYPE_WEAPON && pProto->SubClass == ITEM_SUBCLASS_WEAPON_POLEARM)
1129811269
return EQUIP_ERR_WRONG_SLOT;
11299-
1130011270
else if (type == INVTYPE_WEAPON || type == INVTYPE_WEAPONOFFHAND)
1130111271
{
1130211272
if (!CanDualWield())
@@ -22221,6 +22191,19 @@ void Player::ReportedAfkBy(Player* reporter)
2222122191
reporter->SendDirectMessage(reportAfkResult.Write());
2222222192
}
2222322193

22194+
uint8 Player::GetStartLevel(uint8 playerClass) const
22195+
{
22196+
uint8 startLevel = sWorld->getIntConfig(CONFIG_START_PLAYER_LEVEL);
22197+
22198+
if (playerClass == CLASS_DEATH_KNIGHT)
22199+
startLevel = std::max<uint8>(sWorld->getIntConfig(CONFIG_START_DEATH_KNIGHT_PLAYER_LEVEL), startLevel);
22200+
22201+
if (m_session->HasPermission(rbac::RBAC_PERM_USE_START_GM_LEVEL))
22202+
startLevel = std::max<uint8>(sWorld->getIntConfig(CONFIG_START_GM_LEVEL), startLevel);
22203+
22204+
return startLevel;
22205+
}
22206+
2222422207
WorldLocation Player::GetStartPosition() const
2222522208
{
2222622209
PlayerInfo const* info = sObjectMgr->GetPlayerInfo(GetRace(), GetClass());

src/server/game/Entities/Player/Player.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1673,6 +1673,8 @@ class TC_GAME_API Player : public Unit, public GridObject<Player>
16731673
float OCTRegenMPPerSpirit() const;
16741674
float GetRatingMultiplier(CombatRating cr) const;
16751675
float GetRatingBonusValue(CombatRating cr) const;
1676+
1677+
/// Returns base spellpower bonus from spellpower stat on items
16761678
uint32 GetBaseSpellPowerBonus() const { return m_baseSpellPower; }
16771679
int32 GetSpellPenetrationItemMod() const { return m_spellPenetrationItemMod; }
16781680

@@ -2065,6 +2067,7 @@ class TC_GAME_API Player : public Unit, public GridObject<Player>
20652067
float m_homebindY;
20662068
float m_homebindZ;
20672069

2070+
uint8 GetStartLevel(uint8 playerClass) const;
20682071
WorldLocation GetStartPosition() const;
20692072

20702073
// currently visible objects at player client

src/server/game/Movement/Spline/MoveSplineInit.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ namespace Movement
6161
MoveSpline& move_spline = *unit->movespline;
6262

6363
// Elevators also use MOVEMENTFLAG_ONTRANSPORT but we do not keep track of their position changes (movementInfo.transport.guid is 0 in that case)
64-
bool transport = unit->HasUnitMovementFlag(MOVEMENTFLAG_ONTRANSPORT) && unit->GetTransGUID();
64+
bool transport = unit->HasUnitMovementFlag(MOVEMENTFLAG_ONTRANSPORT) && !unit->GetTransGUID().IsEmpty();
6565
Location real_position;
6666
// there is a big chance that current position is unknown if current state is not finalized, need compute it
6767
// this also allows CalculatePath spline position and update map position in much greater intervals

0 commit comments

Comments
 (0)