Skip to content

Commit 65715e7

Browse files
committed
Core/Misc: Reduce differences between branches
1 parent f536e1a commit 65715e7

File tree

6 files changed

+29
-26
lines changed

6 files changed

+29
-26
lines changed

src/server/game/AI/ScriptedAI/ScriptedCreature.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -337,7 +337,7 @@ class TC_GAME_API BossAI : public ScriptedAI
337337
void _JustEngagedWith(Unit* who);
338338
void _JustDied();
339339
void _JustReachedHome();
340-
void _DespawnAtEvade(Seconds delayToRespawn = 30s, Creature* who = nullptr);
340+
void _DespawnAtEvade(Seconds delayToRespawn = 30s, Creature* who = nullptr);
341341

342342
void TeleportCheaters();
343343

src/server/game/Grids/Notifiers/GridNotifiers.h

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1716,6 +1716,25 @@ namespace Trinity
17161716
ObjectGuid _GUID;
17171717
};
17181718

1719+
class HeightDifferenceCheck
1720+
{
1721+
public:
1722+
HeightDifferenceCheck(WorldObject* go, float diff, bool reverse)
1723+
: _baseObject(go), _difference(diff), _reverse(reverse)
1724+
{
1725+
}
1726+
1727+
bool operator()(WorldObject* unit) const
1728+
{
1729+
return (unit->GetPositionZ() - _baseObject->GetPositionZ() > _difference) != _reverse;
1730+
}
1731+
1732+
private:
1733+
WorldObject* _baseObject;
1734+
float _difference;
1735+
bool _reverse;
1736+
};
1737+
17191738
class UnitAuraCheck
17201739
{
17211740
public:

src/server/game/Handlers/PetitionsHandler.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -624,7 +624,7 @@ void WorldSession::HandleTurnInPetitionOpcode(WorldPacket& recvData)
624624
if (_player->GetGuildId())
625625
{
626626
data.Initialize(SMSG_TURN_IN_PETITION_RESULTS, 4);
627-
data << (uint32)PETITION_TURN_ALREADY_IN_GUILD;
627+
data << uint32(PETITION_TURN_ALREADY_IN_GUILD);
628628
_player->SendDirectMessage(&data);
629629
return;
630630
}

src/server/game/Spells/Spell.cpp

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -904,13 +904,13 @@ uint64 Spell::CalculateDelayMomentForDst() const
904904
{
905905
float speed = m_targets.GetSpeedXY();
906906
if (speed > 0.0f)
907-
return (uint64)floor(m_targets.GetDist2d() / speed * 1000.0f);
907+
return uint64(std::floor(m_targets.GetDist2d() / speed * 1000.0f));
908908
}
909909
else if (m_spellInfo->Speed > 0.0f)
910910
{
911911
// We should not subtract caster size from dist calculation (fixes execution time desync with animation on client, eg. Malleable Goo cast by PP)
912912
float dist = m_caster->GetExactDist(*m_targets.GetDstPos());
913-
return (uint64)std::floor(dist / m_spellInfo->Speed * 1000.0f);
913+
return uint64(std::floor(dist / m_spellInfo->Speed * 1000.0f));
914914
}
915915
}
916916

@@ -2185,6 +2185,7 @@ void Spell::AddUnitTarget(Unit* target, uint32 effectMask, bool checkIfValid /*=
21852185

21862186
if (dist < 5.0f)
21872187
dist = 5.0f;
2188+
21882189
targetInfo.TimeDelay = uint64(std::floor(dist / m_spellInfo->Speed * 1000.0f));
21892190

21902191
// Calculate minimum incoming time
@@ -2269,7 +2270,9 @@ void Spell::AddGOTarget(GameObject* go, uint32 effectMask)
22692270
float dist = m_caster->GetDistance(go->GetPositionX(), go->GetPositionY(), go->GetPositionZ());
22702271
if (dist < 5.0f)
22712272
dist = 5.0f;
2273+
22722274
target.TimeDelay = uint64(std::floor(dist / m_spellInfo->Speed * 1000.0f));
2275+
22732276
if (!m_delayMoment || m_delayMoment > target.TimeDelay)
22742277
m_delayMoment = target.TimeDelay;
22752278
}

src/server/scripts/Northrend/IcecrownCitadel/boss_the_lich_king.cpp

Lines changed: 2 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -393,25 +393,6 @@ class NecroticPlagueTargetCheck
393393
uint32 _notAura2;
394394
};
395395

396-
class HeightDifferenceCheck
397-
{
398-
public:
399-
HeightDifferenceCheck(GameObject* go, float diff, bool reverse)
400-
: _baseObject(go), _difference(diff), _reverse(reverse)
401-
{
402-
}
403-
404-
bool operator()(WorldObject* unit) const
405-
{
406-
return (unit->GetPositionZ() - _baseObject->GetPositionZ() > _difference) != _reverse;
407-
}
408-
409-
private:
410-
GameObject* _baseObject;
411-
float _difference;
412-
bool _reverse;
413-
};
414-
415396
class FrozenThroneResetWorker
416397
{
417398
public:
@@ -1510,7 +1491,7 @@ struct npc_valkyr_shadowguard : public ScriptedAI
15101491
{
15111492
std::list<Creature*> triggers;
15121493
GetCreatureListWithEntryInGrid(triggers, me, NPC_WORLD_TRIGGER, 150.0f);
1513-
triggers.remove_if(HeightDifferenceCheck(platform, 5.0f, true));
1494+
triggers.remove_if(Trinity::HeightDifferenceCheck(platform, 5.0f, true));
15141495
if (triggers.empty())
15151496
return;
15161497

@@ -2196,7 +2177,7 @@ class spell_the_lich_king_quake : public SpellScript
21962177
void FilterTargets(std::list<WorldObject*>& targets)
21972178
{
21982179
if (GameObject* platform = ObjectAccessor::GetGameObject(*GetCaster(), GetCaster()->GetInstanceScript()->GetGuidData(DATA_ARTHAS_PLATFORM)))
2199-
targets.remove_if(HeightDifferenceCheck(platform, 5.0f, false));
2180+
targets.remove_if(Trinity::HeightDifferenceCheck(platform, 5.0f, false));
22002181
}
22012182

22022183
void HandleSendEvent(SpellEffIndex /*effIndex*/)

src/server/scripts/Spells/spell_warlock.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -712,7 +712,7 @@ class spell_warl_life_tap : public SpellScript
712712
return GetCaster()->GetTypeId() == TYPEID_PLAYER;
713713
}
714714

715-
bool Validate(SpellInfo const* /*spell*/) override
715+
bool Validate(SpellInfo const* /*spellInfo*/) override
716716
{
717717
return ValidateSpellInfo({ SPELL_WARLOCK_LIFE_TAP_ENERGIZE, SPELL_WARLOCK_LIFE_TAP_ENERGIZE_2 });
718718
}

0 commit comments

Comments
 (0)