Skip to content

Commit 52a8b27

Browse files
author
Rochet2
committed
Merge TrinityCore 3.3.5 to ElunaTrinityWotlk [skip ci]
2 parents 336b898 + fcfb576 commit 52a8b27

File tree

6 files changed

+64
-56
lines changed

6 files changed

+64
-56
lines changed

src/server/game/Entities/Object/Object.cpp

Lines changed: 22 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -320,15 +320,15 @@ void Object::BuildMovementUpdate(ByteBuffer* data, uint16 flags) const
320320
ASSERT(unit);
321321
unit->BuildMovementPacket(data);
322322

323-
*data << unit->GetSpeed(MOVE_WALK)
324-
<< unit->GetSpeed(MOVE_RUN)
325-
<< unit->GetSpeed(MOVE_RUN_BACK)
326-
<< unit->GetSpeed(MOVE_SWIM)
327-
<< unit->GetSpeed(MOVE_SWIM_BACK)
328-
<< unit->GetSpeed(MOVE_FLIGHT)
329-
<< unit->GetSpeed(MOVE_FLIGHT_BACK)
330-
<< unit->GetSpeed(MOVE_TURN_RATE)
331-
<< unit->GetSpeed(MOVE_PITCH_RATE);
323+
*data << float(unit->GetSpeed(MOVE_WALK));
324+
*data << float(unit->GetSpeed(MOVE_RUN));
325+
*data << float(unit->GetSpeed(MOVE_RUN_BACK));
326+
*data << float(unit->GetSpeed(MOVE_SWIM));
327+
*data << float(unit->GetSpeed(MOVE_SWIM_BACK));
328+
*data << float(unit->GetSpeed(MOVE_FLIGHT));
329+
*data << float(unit->GetSpeed(MOVE_FLIGHT_BACK));
330+
*data << float(unit->GetSpeed(MOVE_TURN_RATE));
331+
*data << float(unit->GetSpeed(MOVE_PITCH_RATE));
332332

333333
// 0x08000000
334334
if (unit->m_movementInfo.GetMovementFlags() & MOVEMENTFLAG_SPLINE_ENABLED)
@@ -346,21 +346,21 @@ void Object::BuildMovementUpdate(ByteBuffer* data, uint16 flags) const
346346
else
347347
*data << uint8(0);
348348

349-
*data << object->GetPositionX();
350-
*data << object->GetPositionY();
351-
*data << object->GetPositionZ();
349+
*data << float(object->GetPositionX());
350+
*data << float(object->GetPositionY());
351+
*data << float(object->GetPositionZ());
352352

353353
if (transport)
354354
{
355-
*data << object->GetTransOffsetX();
356-
*data << object->GetTransOffsetY();
357-
*data << object->GetTransOffsetZ();
355+
*data << float(object->GetTransOffsetX());
356+
*data << float(object->GetTransOffsetY());
357+
*data << float(object->GetTransOffsetZ());
358358
}
359359
else
360360
{
361-
*data << object->GetPositionX();
362-
*data << object->GetPositionY();
363-
*data << object->GetPositionZ();
361+
*data << float(object->GetPositionX());
362+
*data << float(object->GetPositionY());
363+
*data << float(object->GetPositionZ());
364364
}
365365

366366
*data << object->GetOrientation();
@@ -376,10 +376,10 @@ void Object::BuildMovementUpdate(ByteBuffer* data, uint16 flags) const
376376
if (flags & UPDATEFLAG_STATIONARY_POSITION)
377377
{
378378
ASSERT(object);
379-
*data << object->GetStationaryX();
380-
*data << object->GetStationaryY();
381-
*data << object->GetStationaryZ();
382-
*data << object->GetStationaryO();
379+
*data << float(object->GetStationaryX());
380+
*data << float(object->GetStationaryY());
381+
*data << float(object->GetStationaryZ());
382+
*data << float(object->GetStationaryO());
383383
}
384384
}
385385
}
@@ -448,7 +448,6 @@ void Object::BuildMovementUpdate(ByteBuffer* data, uint16 flags) const
448448
// 0x80
449449
if (flags & UPDATEFLAG_VEHICLE)
450450
{
451-
/// @todo Allow players to aquire this updateflag.
452451
ASSERT(unit);
453452
ASSERT(unit->GetVehicleKit());
454453
ASSERT(unit->GetVehicleKit()->GetVehicleInfo());

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

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3699,14 +3699,20 @@ void Player::RemoveSpell(uint32 spell_id, bool disabled, bool learn_low_rank)
36993699
}
37003700
}
37013701

3702-
if (spell_id == 46917 && m_canTitanGrip)
3702+
if (m_canTitanGrip)
37033703
{
3704-
RemoveAurasDueToSpell(m_titanGripPenaltySpellId);
3705-
SetCanTitanGrip(false);
3704+
if (spellInfo && spellInfo->IsPassive() && spellInfo->HasEffect(SPELL_EFFECT_TITAN_GRIP))
3705+
{
3706+
RemoveAurasDueToSpell(m_titanGripPenaltySpellId);
3707+
SetCanTitanGrip(false);
3708+
}
37063709
}
37073710

3708-
if (spell_id == 674 && m_canDualWield)
3709-
SetCanDualWield(false);
3711+
if (m_canDualWield)
3712+
{
3713+
if (spellInfo && spellInfo->IsPassive() && spellInfo->HasEffect(SPELL_EFFECT_DUAL_WIELD))
3714+
SetCanDualWield(false);
3715+
}
37103716

37113717
if (sWorld->getBoolConfig(CONFIG_OFFHAND_CHECK_AT_SPELL_UNLEARN))
37123718
AutoUnequipOffhandIfNeed();

src/server/game/Entities/Unit/Unit.cpp

Lines changed: 20 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1601,7 +1601,7 @@ void Unit::HandleEmoteCommand(Emote emoteId)
16011601
AuraEffectList const& resIgnoreAurasAb = attacker->GetAuraEffectsByType(SPELL_AURA_MOD_ABILITY_IGNORE_TARGET_RESIST);
16021602
for (AuraEffect const* aurEff : resIgnoreAurasAb)
16031603
{
1604-
if (aurEff->GetMiscValue() & SPELL_SCHOOL_MASK_NORMAL && aurEff->IsAffectedOnSpell(spellInfo))
1604+
if (aurEff->GetMiscValue() & SPELL_SCHOOL_MASK_NORMAL && aurEff->IsAffectingSpell(spellInfo))
16051605
armor = std::floor(AddPct(armor, -aurEff->GetAmount()));
16061606
}
16071607

@@ -1700,7 +1700,7 @@ void Unit::HandleEmoteCommand(Emote emoteId)
17001700
{
17011701
ignoredResistance += attacker->GetTotalAuraModifier(SPELL_AURA_MOD_ABILITY_IGNORE_TARGET_RESIST, [schoolMask, spellInfo](AuraEffect const* aurEff) -> bool
17021702
{
1703-
if ((aurEff->GetMiscValue() & schoolMask) && aurEff->IsAffectedOnSpell(spellInfo))
1703+
if ((aurEff->GetMiscValue() & schoolMask) && aurEff->IsAffectingSpell(spellInfo))
17041704
return true;
17051705
return false;
17061706
});
@@ -1786,7 +1786,7 @@ void Unit::HandleEmoteCommand(Emote emoteId)
17861786
if (!(aurEff->GetMiscValue() & damageInfo.GetSchoolMask()))
17871787
return false;
17881788

1789-
if (!aurEff->IsAffectedOnSpell(damageInfo.GetSpellInfo()))
1789+
if (!aurEff->IsAffectingSpell(damageInfo.GetSpellInfo()))
17901790
return false;
17911791

17921792
return true;
@@ -2488,7 +2488,7 @@ SpellMissInfo Unit::MeleeSpellHitResult(Unit* victim, SpellInfo const* spellInfo
24882488
AuraEffectList const& ignore = GetAuraEffectsByType(SPELL_AURA_IGNORE_COMBAT_RESULT);
24892489
for (AuraEffect const* aurEff : ignore)
24902490
{
2491-
if (!aurEff->IsAffectedOnSpell(spellInfo))
2491+
if (!aurEff->IsAffectingSpell(spellInfo))
24922492
continue;
24932493

24942494
switch (aurEff->GetMiscValue())
@@ -4567,7 +4567,7 @@ bool Unit::HasAuraTypeWithAffectMask(AuraType auraType, SpellInfo const* affecte
45674567
{
45684568
AuraEffectList const& mTotalAuraList = GetAuraEffectsByType(auraType);
45694569
for (AuraEffectList::const_iterator i = mTotalAuraList.begin(); i != mTotalAuraList.end(); ++i)
4570-
if ((*i)->IsAffectedOnSpell(affectedSpell))
4570+
if ((*i)->IsAffectingSpell(affectedSpell))
45714571
return true;
45724572
return false;
45734573
}
@@ -4644,7 +4644,7 @@ AuraEffect* Unit::IsScriptOverriden(SpellInfo const* spell, int32 script) const
46444644
for (AuraEffectList::const_iterator i = auras.begin(); i != auras.end(); ++i)
46454645
{
46464646
if ((*i)->GetMiscValue() == script)
4647-
if ((*i)->IsAffectedOnSpell(spell))
4647+
if ((*i)->IsAffectingSpell(spell))
46484648
return (*i);
46494649
}
46504650
return nullptr;
@@ -4895,7 +4895,7 @@ int32 Unit::GetTotalAuraModifierByAffectMask(AuraType auraType, SpellInfo const*
48954895
{
48964896
return GetTotalAuraModifier(auraType, [affectedSpell](AuraEffect const* aurEff) -> bool
48974897
{
4898-
if (aurEff->IsAffectedOnSpell(affectedSpell))
4898+
if (aurEff->IsAffectingSpell(affectedSpell))
48994899
return true;
49004900
return false;
49014901
});
@@ -4905,7 +4905,7 @@ float Unit::GetTotalAuraMultiplierByAffectMask(AuraType auraType, SpellInfo cons
49054905
{
49064906
return GetTotalAuraMultiplier(auraType, [affectedSpell](AuraEffect const* aurEff) -> bool
49074907
{
4908-
if (aurEff->IsAffectedOnSpell(affectedSpell))
4908+
if (aurEff->IsAffectingSpell(affectedSpell))
49094909
return true;
49104910
return false;
49114911
});
@@ -4915,7 +4915,7 @@ int32 Unit::GetMaxPositiveAuraModifierByAffectMask(AuraType auraType, SpellInfo
49154915
{
49164916
return GetMaxPositiveAuraModifier(auraType, [affectedSpell](AuraEffect const* aurEff) -> bool
49174917
{
4918-
if (aurEff->IsAffectedOnSpell(affectedSpell))
4918+
if (aurEff->IsAffectingSpell(affectedSpell))
49194919
return true;
49204920
return false;
49214921
});
@@ -4925,7 +4925,7 @@ int32 Unit::GetMaxNegativeAuraModifierByAffectMask(AuraType auraType, SpellInfo
49254925
{
49264926
return GetMaxNegativeAuraModifier(auraType, [affectedSpell](AuraEffect const* aurEff) -> bool
49274927
{
4928-
if (aurEff->IsAffectedOnSpell(affectedSpell))
4928+
if (aurEff->IsAffectingSpell(affectedSpell))
49294929
return true;
49304930
return false;
49314931
});
@@ -6474,7 +6474,7 @@ uint32 Unit::SpellDamageBonusDone(Unit* victim, SpellInfo const* spellProto, uin
64746474
Unit const* owner = GetOwner() ? GetOwner() : this;
64756475
DoneTotal += owner->GetTotalAuraModifier(SPELL_AURA_OVERRIDE_CLASS_SCRIPTS, [spellProto](AuraEffect const* aurEff) -> bool
64766476
{
6477-
if (!aurEff->IsAffectedOnSpell(spellProto))
6477+
if (!aurEff->IsAffectingSpell(spellProto))
64786478
return false;
64796479

64806480
switch (aurEff->GetMiscValue())
@@ -6646,7 +6646,7 @@ float Unit::SpellDamagePctDone(Unit* victim, SpellInfo const* spellProto, Damage
66466646
AuraEffectList const& mOverrideClassScript = owner->GetAuraEffectsByType(SPELL_AURA_OVERRIDE_CLASS_SCRIPTS);
66476647
for (AuraEffectList::const_iterator i = mOverrideClassScript.begin(); i != mOverrideClassScript.end(); ++i)
66486648
{
6649-
if (!(*i)->IsAffectedOnSpell(spellProto))
6649+
if (!(*i)->IsAffectingSpell(spellProto))
66506650
continue;
66516651

66526652
switch ((*i)->GetMiscValue())
@@ -6955,7 +6955,7 @@ uint32 Unit::SpellDamageBonusTaken(Unit* caster, SpellInfo const* spellProto, ui
69556955
{
69566956
TakenTotalMod *= GetTotalAuraMultiplier(SPELL_AURA_MOD_DAMAGE_FROM_CASTER, [caster, spellProto](AuraEffect const* aurEff) -> bool
69576957
{
6958-
if (aurEff->GetCasterGUID() == caster->GetGUID() && aurEff->IsAffectedOnSpell(spellProto))
6958+
if (aurEff->GetCasterGUID() == caster->GetGUID() && aurEff->IsAffectingSpell(spellProto))
69596959
return true;
69606960
return false;
69616961
});
@@ -7095,7 +7095,7 @@ float Unit::SpellCritChanceTaken(Unit const* caster, SpellInfo const* spellInfo,
70957095
AuraEffectList const& mOverrideClassScript = caster->GetAuraEffectsByType(SPELL_AURA_OVERRIDE_CLASS_SCRIPTS);
70967096
for (AuraEffect const* aurEff : mOverrideClassScript)
70977097
{
7098-
if (!aurEff->IsAffectedOnSpell(spellInfo))
7098+
if (!aurEff->IsAffectingSpell(spellInfo))
70997099
continue;
71007100

71017101
float modChance = 0.f;
@@ -7243,7 +7243,7 @@ float Unit::SpellCritChanceTaken(Unit const* caster, SpellInfo const* spellInfo,
72437243
{
72447244
crit_chance += GetTotalAuraModifier(SPELL_AURA_MOD_CRIT_CHANCE_FOR_CASTER, [caster, spellInfo](AuraEffect const* aurEff) -> bool
72457245
{
7246-
if (aurEff->GetCasterGUID() == caster->GetGUID() && aurEff->IsAffectedOnSpell(spellInfo))
7246+
if (aurEff->GetCasterGUID() == caster->GetGUID() && aurEff->IsAffectingSpell(spellInfo))
72477247
return true;
72487248
return false;
72497249
});
@@ -7349,7 +7349,7 @@ uint32 Unit::SpellHealingBonusDone(Unit* victim, SpellInfo const* spellProto, ui
73497349
AuraEffectList const& mOverrideClassScript= owner->GetAuraEffectsByType(SPELL_AURA_OVERRIDE_CLASS_SCRIPTS);
73507350
for (AuraEffect const* aurEff : mOverrideClassScript)
73517351
{
7352-
if (!aurEff->IsAffectedOnSpell(spellProto))
7352+
if (!aurEff->IsAffectingSpell(spellProto))
73537353
continue;
73547354

73557355
switch (aurEff->GetMiscValue())
@@ -7502,7 +7502,7 @@ float Unit::SpellHealingPctDone(Unit* victim, SpellInfo const* spellProto) const
75027502
AuraEffectList const& mOverrideClassScript= owner->GetAuraEffectsByType(SPELL_AURA_OVERRIDE_CLASS_SCRIPTS);
75037503
for (AuraEffect const* aurEff : mOverrideClassScript)
75047504
{
7505-
if (!aurEff->IsAffectedOnSpell(spellProto))
7505+
if (!aurEff->IsAffectingSpell(spellProto))
75067506
continue;
75077507

75087508
switch (aurEff->GetMiscValue())
@@ -7591,7 +7591,7 @@ uint32 Unit::SpellHealingBonusTaken(Unit* caster, SpellInfo const* spellProto, u
75917591
{
75927592
TakenTotalMod *= GetTotalAuraMultiplier(SPELL_AURA_MOD_HEALING_RECEIVED, [caster, spellProto](AuraEffect const* aurEff) -> bool
75937593
{
7594-
if (caster->GetGUID() == aurEff->GetCasterGUID() && aurEff->IsAffectedOnSpell(spellProto))
7594+
if (caster->GetGUID() == aurEff->GetCasterGUID() && aurEff->IsAffectingSpell(spellProto))
75957595
return true;
75967596
return false;
75977597
});
@@ -7946,7 +7946,7 @@ uint32 Unit::MeleeDamageBonusDone(Unit* victim, uint32 pdamage, WeaponAttackType
79467946
AuraEffectList const& mOverrideClassScript = owner->GetAuraEffectsByType(SPELL_AURA_OVERRIDE_CLASS_SCRIPTS);
79477947
for (AuraEffectList::const_iterator i = mOverrideClassScript.begin(); i != mOverrideClassScript.end(); ++i)
79487948
{
7949-
if (!(*i)->IsAffectedOnSpell(spellProto))
7949+
if (!(*i)->IsAffectingSpell(spellProto))
79507950
continue;
79517951

79527952
switch ((*i)->GetMiscValue())
@@ -8054,7 +8054,7 @@ uint32 Unit::MeleeDamageBonusTaken(Unit* attacker, uint32 pdamage, WeaponAttackT
80548054
// From caster spells
80558055
TakenTotalMod *= GetTotalAuraMultiplier(SPELL_AURA_MOD_DAMAGE_FROM_CASTER, [attacker, spellProto](AuraEffect const* aurEff) -> bool
80568056
{
8057-
if (aurEff->GetCasterGUID() == attacker->GetGUID() && aurEff->IsAffectedOnSpell(spellProto))
8057+
if (aurEff->GetCasterGUID() == attacker->GetGUID() && aurEff->IsAffectingSpell(spellProto))
80588058
return true;
80598059
return false;
80608060
});

src/server/game/Spells/Auras/SpellAuraEffects.cpp

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -483,7 +483,7 @@ int32 AuraEffect::CalculateAmount(Unit* caster)
483483
Unit::AuraEffectList const& overrideClassScripts = caster->GetAuraEffectsByType(SPELL_AURA_OVERRIDE_CLASS_SCRIPTS);
484484
for (Unit::AuraEffectList::const_iterator itr = overrideClassScripts.begin(); itr != overrideClassScripts.end(); ++itr)
485485
{
486-
if ((*itr)->IsAffectedOnSpell(m_spellInfo))
486+
if ((*itr)->IsAffectingSpell(m_spellInfo))
487487
{
488488
// Glyph of Fear, Glyph of Frost nova and similar auras
489489
if ((*itr)->GetMiscValue() == 7801)
@@ -845,7 +845,7 @@ float AuraEffect::GetCritChanceFor(Unit const* caster, Unit const* target) const
845845
return target->SpellCritChanceTaken(caster, GetSpellInfo(), GetSpellInfo()->GetSchoolMask(), GetBase()->GetCritChance(), GetSpellInfo()->GetAttackType(), true);
846846
}
847847

848-
bool AuraEffect::IsAffectedOnSpell(SpellInfo const* spell) const
848+
bool AuraEffect::IsAffectingSpell(SpellInfo const* spell) const
849849
{
850850
if (!spell)
851851
return false;
@@ -4988,7 +4988,7 @@ void AuraEffect::HandleAuraSetVehicle(AuraApplication const* aurApp, uint8 mode,
49884988

49894989
Unit* target = aurApp->GetTarget();
49904990

4991-
if (target->GetTypeId() != TYPEID_PLAYER || !target->IsInWorld())
4991+
if (!target->IsInWorld())
49924992
return;
49934993

49944994
uint32 vehicleId = GetMiscValue();
@@ -5001,6 +5001,9 @@ void AuraEffect::HandleAuraSetVehicle(AuraApplication const* aurApp, uint8 mode,
50015001
else if (target->GetVehicleKit())
50025002
target->RemoveVehicleKit();
50035003

5004+
if (target->GetTypeId() != TYPEID_PLAYER)
5005+
return;
5006+
50045007
WorldPacket data(SMSG_PLAYER_VEHICLE_DATA, target->GetPackGUID().size()+4);
50055008
data << target->GetPackGUID();
50065009
data << uint32(apply ? vehicleId : 0);

src/server/game/Spells/Auras/SpellAuraEffects.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ class TC_GAME_API AuraEffect
8383

8484
bool IsPeriodic() const { return m_isPeriodic; }
8585
void SetPeriodic(bool isPeriodic) { m_isPeriodic = isPeriodic; }
86-
bool IsAffectedOnSpell(SpellInfo const* spell) const;
86+
bool IsAffectingSpell(SpellInfo const* spell) const;
8787
bool HasSpellClassMask() const { return GetSpellEffectInfo().SpellClassMask; }
8888

8989
void SendTickImmune(Unit* target, Unit* caster) const;

src/server/game/Spells/Spell.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3940,7 +3940,7 @@ void Spell::finish(bool ok)
39403940
Unit::AuraEffectList const& vIgnoreReset = unitCaster->GetAuraEffectsByType(SPELL_AURA_IGNORE_MELEE_RESET);
39413941
for (Unit::AuraEffectList::const_iterator i = vIgnoreReset.begin(); i != vIgnoreReset.end(); ++i)
39423942
{
3943-
if ((*i)->IsAffectedOnSpell(m_spellInfo))
3943+
if ((*i)->IsAffectingSpell(m_spellInfo))
39443944
{
39453945
found = true;
39463946
break;
@@ -5218,7 +5218,7 @@ SpellCastResult Spell::CheckCast(bool strict, uint32* param1 /*= nullptr*/, uint
52185218
Unit::AuraEffectList const& ignore = unitCaster->GetAuraEffectsByType(SPELL_AURA_MOD_IGNORE_SHAPESHIFT);
52195219
for (AuraEffect const* aurEff : ignore)
52205220
{
5221-
if (!aurEff->IsAffectedOnSpell(m_spellInfo))
5221+
if (!aurEff->IsAffectingSpell(m_spellInfo))
52225222
continue;
52235223

52245224
checkForm = false;
@@ -5244,7 +5244,7 @@ SpellCastResult Spell::CheckCast(bool strict, uint32* param1 /*= nullptr*/, uint
52445244
Unit::AuraEffectList const& stateAuras = unitCaster->GetAuraEffectsByType(SPELL_AURA_ABILITY_IGNORE_AURASTATE);
52455245
for (Unit::AuraEffectList::const_iterator j = stateAuras.begin(); j != stateAuras.end(); ++j)
52465246
{
5247-
if ((*j)->IsAffectedOnSpell(m_spellInfo))
5247+
if ((*j)->IsAffectingSpell(m_spellInfo))
52485248
{
52495249
m_needComboPoints = false;
52505250
if ((*j)->GetMiscValue() == 1)
@@ -8165,7 +8165,7 @@ void Spell::PrepareTriggersExecutedOnHit()
81658165
Unit::AuraEffectList const& targetTriggers = unitCaster->GetAuraEffectsByType(SPELL_AURA_ADD_TARGET_TRIGGER);
81668166
for (AuraEffect const* aurEff : targetTriggers)
81678167
{
8168-
if (!aurEff->IsAffectedOnSpell(m_spellInfo))
8168+
if (!aurEff->IsAffectingSpell(m_spellInfo))
81698169
continue;
81708170

81718171
SpellInfo const* auraSpellInfo = aurEff->GetSpellInfo();

0 commit comments

Comments
 (0)