diff options
author | Shauren <shauren.trinity@gmail.com> | 2025-09-24 15:35:26 +0200 |
---|---|---|
committer | Shauren <shauren.trinity@gmail.com> | 2025-09-25 00:53:12 +0200 |
commit | 548817202ebbbb11b9b0372c2bf07b7fa0a1f814 (patch) | |
tree | 273eeb768b38bb7da51d98a3808e905d7ab5513c /src/server | |
parent | 3bb4f5677359e3af9fe4b80e42157816786dca49 (diff) |
Core/Misc: Reduce differences between branches
Diffstat (limited to 'src/server')
19 files changed, 130 insertions, 112 deletions
diff --git a/src/server/game/DungeonFinding/LFGMgr.cpp b/src/server/game/DungeonFinding/LFGMgr.cpp index e39d5f9c0db..69a78c2f53e 100644 --- a/src/server/game/DungeonFinding/LFGMgr.cpp +++ b/src/server/game/DungeonFinding/LFGMgr.cpp @@ -1997,18 +1997,22 @@ bool LFGMgr::IsLfgGroup(ObjectGuid guid) return guid && guid.IsGroup() && GroupsStore[guid].IsLfgGroup(); } -LFGQueue& LFGMgr::GetQueue(ObjectGuid guid) +uint8 LFGMgr::GetQueueId(ObjectGuid guid) { - uint8 queueId = 0; if (guid.IsGroup()) { GuidSet const& players = GetPlayers(guid); ObjectGuid pguid = players.empty() ? ObjectGuid::Empty : (*players.begin()); - if (pguid) - queueId = GetTeam(pguid); + if (!pguid.IsEmpty()) + return GetTeam(pguid); } - else - queueId = GetTeam(guid); + + return GetTeam(guid); +} + +LFGQueue& LFGMgr::GetQueue(ObjectGuid guid) +{ + uint8 queueId = GetQueueId(guid); return QueuesStore[queueId]; } @@ -2031,6 +2035,16 @@ bool LFGMgr::AllQueued(GuidList const& check) return true; } +time_t LFGMgr::GetQueueJoinTime(ObjectGuid guid) +{ + uint8 queueId = GetQueueId(guid); + LfgQueueContainer::const_iterator itr = QueuesStore.find(queueId); + if (itr != QueuesStore.end()) + return itr->second.GetJoinTime(guid); + + return 0; +} + // Only for debugging purposes void LFGMgr::Clean() { diff --git a/src/server/game/DungeonFinding/LFGMgr.h b/src/server/game/DungeonFinding/LFGMgr.h index 71ef7f35a5e..d8a19d14a52 100644 --- a/src/server/game/DungeonFinding/LFGMgr.h +++ b/src/server/game/DungeonFinding/LFGMgr.h @@ -417,8 +417,12 @@ class TC_GAME_API LFGMgr uint8 GetPlayerCount(ObjectGuid guid); /// Add a new Proposal uint32 AddProposal(LfgProposal& proposal); + /// Returns queue id + uint8 GetQueueId(ObjectGuid guid); /// Checks if all players are queued bool AllQueued(GuidList const& check); + /// Gets queue join time + time_t GetQueueJoinTime(ObjectGuid guid); /// Checks if given roles match, modifies given roles map with new roles static bool CheckGroupRoles(LfgRolesMap &groles); /// Checks if given players are ignoring each other diff --git a/src/server/game/DungeonFinding/LFGQueue.cpp b/src/server/game/DungeonFinding/LFGQueue.cpp index 1580206eacf..f9a3c8c9ccc 100644 --- a/src/server/game/DungeonFinding/LFGQueue.cpp +++ b/src/server/game/DungeonFinding/LFGQueue.cpp @@ -636,9 +636,13 @@ void LFGQueue::UpdateQueueTimers(time_t currTime) } } -time_t LFGQueue::GetJoinTime(ObjectGuid guid) +time_t LFGQueue::GetJoinTime(ObjectGuid guid) const { - return QueueDataStore[guid].joinTime; + LfgQueueDataContainer::const_iterator itr = QueueDataStore.find(guid); + if (itr != QueueDataStore.end()) + return itr->second.joinTime; + + return 0; } std::string LFGQueue::DumpQueueInfo() const diff --git a/src/server/game/DungeonFinding/LFGQueue.h b/src/server/game/DungeonFinding/LFGQueue.h index ef568e3ab37..e2109870912 100644 --- a/src/server/game/DungeonFinding/LFGQueue.h +++ b/src/server/game/DungeonFinding/LFGQueue.h @@ -100,7 +100,7 @@ class TC_GAME_API LFGQueue // Update Queue timers void UpdateQueueTimers(time_t currTime); - time_t GetJoinTime(ObjectGuid guid); + time_t GetJoinTime(ObjectGuid guid) const; // Find new group uint8 FindGroups(); diff --git a/src/server/game/Entities/Creature/TemporarySummon.cpp b/src/server/game/Entities/Creature/TemporarySummon.cpp index 2afc0f90307..b93e7f604d5 100644 --- a/src/server/game/Entities/Creature/TemporarySummon.cpp +++ b/src/server/game/Entities/Creature/TemporarySummon.cpp @@ -198,7 +198,8 @@ void TempSummon::InitStats(uint32 duration) if (owner) { - if (uint32 slot = m_Properties->Slot) + std::ptrdiff_t slot = m_Properties->Slot; + if (slot != 0) { if (owner->m_SummonSlot[slot] && owner->m_SummonSlot[slot] != GetGUID()) { @@ -287,10 +288,10 @@ void TempSummon::RemoveFromWorld() return; if (m_Properties) - if (uint32 slot = m_Properties->Slot) - if (Unit* owner = GetSummonerUnit()) - if (owner->m_SummonSlot[slot] == GetGUID()) - owner->m_SummonSlot[slot].Clear(); + if (Unit* owner = GetSummonerUnit()) + for (ObjectGuid& summonSlot : owner->m_SummonSlot) + if (summonSlot == GetGUID()) + summonSlot.Clear(); //if (GetOwnerGUID()) // TC_LOG_ERROR("entities.unit", "Unit {} has owner guid when removed from world", GetEntry()); diff --git a/src/server/game/Entities/Object/Object.cpp b/src/server/game/Entities/Object/Object.cpp index 8369422829f..e3272423b27 100644 --- a/src/server/game/Entities/Object/Object.cpp +++ b/src/server/game/Entities/Object/Object.cpp @@ -1773,13 +1773,6 @@ void Object::ForceValuesUpdateAtIndex(uint32 i) AddToObjectUpdateIfNeeded(); } -void Unit::BuildHeartBeatMsg(WorldPacket* data) const -{ - data->Initialize(MSG_MOVE_HEARTBEAT, 32); - *data << GetPackGUID(); - BuildMovementPacket(data); -} - void WorldObject::SendMessageToSet(WorldPacket const* data, bool self) const { if (IsInWorld()) diff --git a/src/server/game/Entities/Player/Player.cpp b/src/server/game/Entities/Player/Player.cpp index f26b01dc58a..0d50aadd992 100644 --- a/src/server/game/Entities/Player/Player.cpp +++ b/src/server/game/Entities/Player/Player.cpp @@ -4391,7 +4391,7 @@ void Player::BuildPlayerRepop() SetHealth(1); SetWaterWalking(true); - if (!GetSession()->isLogingOut()) + if (!GetSession()->isLogingOut() && !HasUnitState(UNIT_STATE_STUNNED)) SetRooted(false); // BG - remove insignia related @@ -4434,7 +4434,8 @@ void Player::ResurrectPlayer(float restore_percent, bool applySickness) // add the flag to make sure opcode is always sent AddUnitMovementFlag(MOVEMENTFLAG_WATERWALKING); SetWaterWalking(false); - SetRooted(false); + if (!HasUnitState(UNIT_STATE_STUNNED)) + SetRooted(false); m_deathTimer = 0; @@ -21665,7 +21666,7 @@ bool Player::BuyItemFromVendorSlot(ObjectGuid vendorguid, uint32 vendorslot, uin // item base price for (uint8 i = 0; i < MAX_ITEM_EXTENDED_COST_REQUIREMENTS; ++i) { - if (iece->ItemID[i] && !HasItemCount(iece->ItemID[i], (iece->ItemCount[i] * stacks))) + if (iece->ItemID[i] && !HasItemCount(iece->ItemID[i], iece->ItemCount[i] * stacks)) { SendEquipError(EQUIP_ERR_VENDOR_MISSING_TURNINS, nullptr, nullptr); return false; diff --git a/src/server/game/Entities/Player/Player.h b/src/server/game/Entities/Player/Player.h index bd1ece31ed6..0da59a48923 100644 --- a/src/server/game/Entities/Player/Player.h +++ b/src/server/game/Entities/Player/Player.h @@ -397,7 +397,7 @@ static_assert((PLAYER_FIELD_BYTES_2_OFFSET_OVERRIDE_SPELLS_ID & 1) == 0, "PLAYER #define PLAYER_BYTES_2_OVERRIDE_SPELLS_UINT16_OFFSET (PLAYER_FIELD_BYTES_2_OFFSET_OVERRIDE_SPELLS_ID / 2) #define KNOWN_TITLES_SIZE 3 -#define MAX_TITLE_INDEX (KNOWN_TITLES_SIZE*64) // 3 uint64 fields +#define MAX_TITLE_INDEX (KNOWN_TITLES_SIZE * 64) // 3 uint64 fields // used in PLAYER_FIELD_BYTES values enum PlayerFieldByteFlags diff --git a/src/server/game/Entities/Unit/Unit.cpp b/src/server/game/Entities/Unit/Unit.cpp index 220ee3c71db..6ef932fc5e5 100644 --- a/src/server/game/Entities/Unit/Unit.cpp +++ b/src/server/game/Entities/Unit/Unit.cpp @@ -323,8 +323,6 @@ Unit::Unit(bool isWorldObject) : m_movementCounter = 0; - m_rootTimes = 0; - m_state = 0; m_deathState = ALIVE; @@ -8197,8 +8195,7 @@ void Unit::Mount(uint32 mount, uint32 VehicleId, uint32 creatureEntry) data << uint32(VehicleId); SendMessageToSet(&data, true); - data.Initialize(SMSG_ON_CANCEL_EXPECTED_RIDE_VEHICLE_AURA, 0); - player->SendDirectMessage(&data); + player->SendOnCancelExpectedVehicleRideAura(); // mounts can also have accessories GetVehicleKit()->InstallAllAccessories(false); @@ -11309,7 +11306,8 @@ void Unit::SetControlled(bool apply, UnitState state) return; ClearUnitState(state); - SetRooted(false); + if (!HasUnitState(UNIT_STATE_STUNNED)) + SetRooted(false); break; case UNIT_STATE_CONFUSED: if (HasAuraType(SPELL_AURA_MOD_CONFUSE)) @@ -11353,9 +11351,6 @@ void Unit::SetStunned(bool apply) { if (apply) { - if (m_rootTimes > 0) // blizzard internal check? - m_rootTimes++; - SetTarget(ObjectGuid::Empty); SetUnitFlag(UNIT_FLAG_STUNNED); @@ -11373,7 +11368,7 @@ void Unit::SetStunned(bool apply) { WorldPacket data(SMSG_FORCE_MOVE_ROOT, 10); data << GetPackGUID(); - data << m_rootTimes; + data << GetMovementCounterAndInc(); SendMessageToSet(&data, true); } else @@ -11401,7 +11396,7 @@ void Unit::SetStunned(bool apply) { WorldPacket data(SMSG_FORCE_MOVE_UNROOT, 10); data << GetPackGUID(); - data << ++m_rootTimes; + data << GetMovementCounterAndInc(); SendMessageToSet(&data, true); } else @@ -11420,50 +11415,34 @@ void Unit::SetRooted(bool apply) { if (apply) { - if (m_rootTimes > 0) // blizzard internal check? - m_rootTimes++; - // MOVEMENTFLAG_ROOT cannot be used in conjunction with MOVEMENTFLAG_MASK_MOVING (tested 3.3.5a) // this will freeze clients. That's why we remove MOVEMENTFLAG_MASK_MOVING before // setting MOVEMENTFLAG_ROOT RemoveUnitMovementFlag(MOVEMENTFLAG_MASK_MOVING); AddUnitMovementFlag(MOVEMENTFLAG_ROOT); StopMoving(); - - if (GetTypeId() == TYPEID_PLAYER) - { - WorldPacket data(SMSG_FORCE_MOVE_ROOT, 10); - data << GetPackGUID(); - data << m_rootTimes; - SendMessageToSet(&data, true); - } - else - { - WorldPacket data(SMSG_SPLINE_MOVE_ROOT, 8); - data << GetPackGUID(); - SendMessageToSet(&data, true); - } } else + RemoveUnitMovementFlag(MOVEMENTFLAG_ROOT); + + static OpcodeServer const rootOpcodeTable[2][2] = { - if (!HasUnitState(UNIT_STATE_STUNNED)) // prevent moving if it also has stun effect - { - if (GetTypeId() == TYPEID_PLAYER) - { - WorldPacket data(SMSG_FORCE_MOVE_UNROOT, 10); - data << GetPackGUID(); - data << ++m_rootTimes; - SendMessageToSet(&data, true); - } - else - { - WorldPacket data(SMSG_SPLINE_MOVE_UNROOT, 8); - data << GetPackGUID(); - SendMessageToSet(&data, true); - } + { SMSG_SPLINE_MOVE_UNROOT, SMSG_FORCE_MOVE_UNROOT }, + { SMSG_SPLINE_MOVE_ROOT, SMSG_FORCE_MOVE_ROOT } + }; - RemoveUnitMovementFlag(MOVEMENTFLAG_ROOT); - } + if (GetTypeId() == TYPEID_PLAYER) + { + WorldPacket data(rootOpcodeTable[apply][1], 10); + data << GetPackGUID(); + data << GetMovementCounterAndInc(); + SendMessageToSet(&data, true); + } + else + { + WorldPacket data(rootOpcodeTable[apply][0], 8); + data << GetPackGUID(); + SendMessageToSet(&data, true); } } @@ -12878,6 +12857,13 @@ void Unit::NearTeleportTo(Position const& pos, bool casting /*= false*/) } } +void Unit::BuildHeartBeatMsg(WorldPacket* data) const +{ + data->Initialize(MSG_MOVE_HEARTBEAT, 32); + *data << GetPackGUID(); + BuildMovementPacket(data); +} + void Unit::SendTeleportPacket(Position const& pos, bool teleportingTransport /*= false*/) { // MSG_MOVE_TELEPORT is sent to nearby players to signal the teleport diff --git a/src/server/game/Entities/Unit/Unit.h b/src/server/game/Entities/Unit/Unit.h index 8f5ce6448ae..1ded28f3b57 100644 --- a/src/server/game/Entities/Unit/Unit.h +++ b/src/server/game/Entities/Unit/Unit.h @@ -1936,7 +1936,6 @@ class TC_GAME_API Unit : public WorldObject void SetRooted(bool apply); private: - uint32 m_rootTimes; uint32 m_state; // Even derived shouldn't modify uint32 m_lastManaUse; // msecs diff --git a/src/server/game/Handlers/LFGHandler.cpp b/src/server/game/Handlers/LFGHandler.cpp index 2ba9dff0b6e..33952a1dfda 100644 --- a/src/server/game/Handlers/LFGHandler.cpp +++ b/src/server/game/Handlers/LFGHandler.cpp @@ -91,14 +91,14 @@ void WorldSession::HandleLfgLeaveOpcode(WorldPackets::LFG::LFGLeave& /*packet*/) void WorldSession::HandleLfgProposalResultOpcode(WorldPacket& recvData) { - uint32 lfgGroupID; // Internal lfgGroupID - bool accept; // Accept to join? - recvData >> lfgGroupID; + uint32 proposalID; // Proposal ID + bool accept; + recvData >> proposalID; recvData >> accept; TC_LOG_DEBUG("lfg", "CMSG_LFG_PROPOSAL_RESULT {} proposal: {} accept: {}", - GetPlayerInfo(), lfgGroupID, accept ? 1 : 0); - sLFGMgr->UpdateProposal(lfgGroupID, GetPlayer()->GetGUID(), accept); + GetPlayerInfo(), proposalID, accept ? 1 : 0); + sLFGMgr->UpdateProposal(proposalID, GetPlayer()->GetGUID(), accept); } void WorldSession::HandleLfgSetRolesOpcode(WorldPacket& recvData) @@ -153,10 +153,16 @@ void WorldSession::HandleLfgTeleportOpcode(WorldPacket& recvData) void WorldSession::HandleLfgPlayerLockInfoRequestOpcode(WorldPacket& /*recvData*/) { - ObjectGuid guid = GetPlayer()->GetGUID(); TC_LOG_DEBUG("lfg", "CMSG_LFG_PLAYER_LOCK_INFO_REQUEST {}", GetPlayerInfo()); + SendLfgPlayerLockInfo(); +} + +void WorldSession::SendLfgPlayerLockInfo() +{ + ObjectGuid guid = GetPlayer()->GetGUID(); + // Get Random dungeons that can be done at a certain level and expansion uint8 level = GetPlayer()->GetLevel(); lfg::LfgDungeonSet const& randomDungeons = @@ -224,9 +230,15 @@ void WorldSession::HandleLfgPlayerLockInfoRequestOpcode(WorldPacket& /*recvData* void WorldSession::HandleLfgPartyLockInfoRequestOpcode(WorldPacket& /*recvData*/) { - ObjectGuid guid = GetPlayer()->GetGUID(); TC_LOG_DEBUG("lfg", "CMSG_LFG_PARTY_LOCK_INFO_REQUEST {}", GetPlayerInfo()); + SendLfgPartyLockInfo(); +} + +void WorldSession::SendLfgPartyLockInfo() +{ + ObjectGuid guid = GetPlayer()->GetGUID(); + Group* group = GetPlayer()->GetGroup(); if (!group) return; @@ -575,6 +587,7 @@ void WorldSession::SendLfgUpdateProposal(lfg::LfgProposal const& proposal) for (lfg::LfgProposalPlayerContainer::const_iterator it = proposal.players.begin(); it != proposal.players.end(); ++it) { lfg::LfgProposalPlayer const& player = it->second; + data << uint32(player.role); // Role data << uint8(it->first == guid); // Self player if (!player.group) // Player not it a group @@ -587,6 +600,7 @@ void WorldSession::SendLfgUpdateProposal(lfg::LfgProposal const& proposal) data << uint8(player.group == proposal.group); // In dungeon (silent) data << uint8(player.group == gguid); // Same Group than player } + data << uint8(player.accept != lfg::LFG_ANSWER_PENDING);// Answered data << uint8(player.accept == lfg::LFG_ANSWER_AGREE); // Accepted } diff --git a/src/server/game/Handlers/NPCHandler.cpp b/src/server/game/Handlers/NPCHandler.cpp index 16edca25436..38d5dedcad4 100644 --- a/src/server/game/Handlers/NPCHandler.cpp +++ b/src/server/game/Handlers/NPCHandler.cpp @@ -45,6 +45,7 @@ enum StableResultCode { STABLE_ERR_MONEY = 0x01, // "you don't have enough money" + STABLE_ERR_INVALID_SLOT = 0x03, // "That slot is locked" STABLE_ERR_STABLE = 0x06, // currently used in most fail cases STABLE_SUCCESS_STABLE = 0x08, // stable success STABLE_SUCCESS_UNSTABLE = 0x09, // unstable/swap success @@ -437,7 +438,7 @@ void WorldSession::HandleStablePet(WorldPacket& recvData) } // not free stable slot - SendPetStableResult(STABLE_ERR_STABLE); + SendPetStableResult(STABLE_ERR_INVALID_SLOT); } void WorldSession::HandleUnstablePet(WorldPacket& recvData) diff --git a/src/server/game/Movement/MovementGenerators/IdleMovementGenerator.cpp b/src/server/game/Movement/MovementGenerators/IdleMovementGenerator.cpp index 0d3322f3daf..0dd99243ea0 100755 --- a/src/server/game/Movement/MovementGenerators/IdleMovementGenerator.cpp +++ b/src/server/game/Movement/MovementGenerators/IdleMovementGenerator.cpp @@ -100,18 +100,7 @@ bool RotateMovementGenerator::Update(Unit* owner, uint32 diff) return false; float angle = owner->GetOrientation(); - if (_direction == ROTATE_DIRECTION_LEFT) - { - angle += float(diff) * float(M_PI) * 2.f / float(_maxDuration); - while (angle >= float(M_PI) * 2.f) - angle -= float(M_PI) * 2.f; - } - else - { - angle -= float(diff) * float(M_PI) * 2.f / float(_maxDuration); - while (angle < 0.f) - angle += float(M_PI) * 2.f; - } + angle += (float(diff) * static_cast<float>(M_PI * 2) / _maxDuration) * (_direction == ROTATE_DIRECTION_LEFT ? 1.0f : -1.0f); Movement::MoveSplineInit init(owner); init.MoveTo(PositionToVector3(*owner), false); diff --git a/src/server/game/Movement/Spline/MoveSplineInit.h b/src/server/game/Movement/Spline/MoveSplineInit.h index 6fcd3258443..957f4a8ba54 100644 --- a/src/server/game/Movement/Spline/MoveSplineInit.h +++ b/src/server/game/Movement/Spline/MoveSplineInit.h @@ -104,27 +104,35 @@ namespace Movement * if not enabled linear spline mode will be choosen. Disabled by default */ void SetSmooth(); + /* Enables CatmullRom spline interpolation mode, enables flying animation. Disabled by default */ void SetFly(); + /* Enables walk mode. Disabled by default */ void SetWalk(bool enable); + /* Makes movement cyclic. Disabled by default */ void SetCyclic(); + /* Enables falling mode. Disabled by default */ void SetFall(); + /* Enters transport. Disabled by default */ void SetTransportEnter(); + /* Exits transport. Disabled by default */ void SetTransportExit(); + /* Inverses unit model orientation. Disabled by default */ void SetBackward(); + /* Fixes unit's model rotation. Disabled by default */ void SetOrientationFixed(bool enable); diff --git a/src/server/game/Movement/Spline/MovementUtil.cpp b/src/server/game/Movement/Spline/MovementUtil.cpp index b08350e267b..e7209373ccf 100644 --- a/src/server/game/Movement/Spline/MovementUtil.cpp +++ b/src/server/game/Movement/Spline/MovementUtil.cpp @@ -103,12 +103,12 @@ namespace Movement STR(Falling ), // 0x00001000, STR(Fallingfar ), // 0x00002000, STR(Pendingstop ), // 0x00004000, - STR(PendingSTRafestop ), // 0x00008000, - STR(Pendingforward ), // 0x00010000, - STR(Pendingbackward ), // 0x00020000, - STR(PendingSTRafeleft ), // 0x00040000, - STR(PendingSTRaferight ), // 0x00080000, - STR(Pendingroot ), // 0x00100000, + STR(PendingStrafeStop ), // 0x00008000, + STR(PendingForward ), // 0x00010000, + STR(PendingBackward ), // 0x00020000, + STR(PendingStrafeReft ), // 0x00040000, + STR(PendingStrafeRight ), // 0x00080000, + STR(PendingRoot ), // 0x00100000, STR(Swimming ), // 0x00200000, // Appears With Fly Flag Also STR(Ascending ), // 0x00400000, // Swim Up Also STR(Descending ), // 0x00800000, // Swim Down Also @@ -120,11 +120,11 @@ namespace Movement STR(Safe_Fall ), // 0x20000000, // Active Rogue Safe Fall Spell (Passive) STR(Hover ), // 0x40000000 STR(Unknown13 ), // 0x80000000 - STR(Unk1 ), - STR(Unk2 ), + STR(NoStrafe ), + STR(NoJump ), STR(Unk3 ), - STR(Fullspeedturning ), - STR(Fullspeedpitching ), + STR(FullSpeedTurning ), + STR(FullSpeedPitching ), STR(Allow_Pitching ), STR(Unk4 ), STR(Unk5 ), diff --git a/src/server/game/Server/WorldSession.h b/src/server/game/Server/WorldSession.h index 00abbdd7dde..d80eb1d1526 100644 --- a/src/server/game/Server/WorldSession.h +++ b/src/server/game/Server/WorldSession.h @@ -1079,6 +1079,8 @@ class TC_GAME_API WorldSession void HandleLfgSetCommentOpcode(WorldPacket& recvData); void HandleLfgPlayerLockInfoRequestOpcode(WorldPacket& recvData); void HandleLfgPartyLockInfoRequestOpcode(WorldPacket& recvData); + void SendLfgPlayerLockInfo(); + void SendLfgPartyLockInfo(); void HandleLfgJoinOpcode(WorldPackets::LFG::LFGJoin& lfgJoin); void HandleLfgLeaveOpcode(WorldPackets::LFG::LFGLeave& lfgleave); void HandleLfgSetRolesOpcode(WorldPacket& recvData); diff --git a/src/server/game/Spells/SpellEffects.cpp b/src/server/game/Spells/SpellEffects.cpp index 552220fe238..f0267cca44a 100644 --- a/src/server/game/Spells/SpellEffects.cpp +++ b/src/server/game/Spells/SpellEffects.cpp @@ -3801,13 +3801,13 @@ void Spell::EffectApplyGlyph() } // apply new one - if (uint32 glyph = effectInfo->MiscValue) + if (uint32 newGlyph = effectInfo->MiscValue) { - if (GlyphPropertiesEntry const* gp = sGlyphPropertiesStore.LookupEntry(glyph)) + if (GlyphPropertiesEntry const* newGlyphProperties = sGlyphPropertiesStore.LookupEntry(newGlyph)) { - if (GlyphSlotEntry const* gs = sGlyphSlotStore.LookupEntry(player->GetGlyphSlot(m_glyphIndex))) + if (GlyphSlotEntry const* newGlyphSlot = sGlyphSlotStore.LookupEntry(player->GetGlyphSlot(m_glyphIndex))) { - if (gp->GlyphSlotFlags != gs->Type) + if (newGlyphProperties->GlyphSlotFlags != newGlyphSlot->Type) { SendCastResult(SPELL_FAILED_INVALID_GLYPH); return; // glyph slot mismatch @@ -3815,17 +3815,17 @@ void Spell::EffectApplyGlyph() } // remove old glyph - if (uint32 oldglyph = player->GetGlyph(player->GetActiveSpec(), m_glyphIndex)) + if (uint32 oldGlyph = player->GetGlyph(player->GetActiveSpec(), m_glyphIndex)) { - if (GlyphPropertiesEntry const* old_gp = sGlyphPropertiesStore.LookupEntry(oldglyph)) + if (GlyphPropertiesEntry const* oldGlyphProperties = sGlyphPropertiesStore.LookupEntry(oldGlyph)) { - player->RemoveAurasDueToSpell(old_gp->SpellID); + player->RemoveAurasDueToSpell(oldGlyphProperties->SpellID); player->SetGlyph(m_glyphIndex, 0); } } - player->CastSpell(player, gp->SpellID, true); - player->SetGlyph(m_glyphIndex, glyph); + player->CastSpell(player, newGlyphProperties->SpellID, true); + player->SetGlyph(m_glyphIndex, newGlyph); player->SendTalentsInfoData(false); } } diff --git a/src/server/scripts/Commands/cs_cheat.cpp b/src/server/scripts/Commands/cs_cheat.cpp index a112169d903..af782b2d509 100644 --- a/src/server/scripts/Commands/cs_cheat.cpp +++ b/src/server/scripts/Commands/cs_cheat.cpp @@ -165,13 +165,13 @@ public: if (enable) { handler->GetSession()->GetPlayer()->SetCommandStatusOn(CHEAT_WATERWALK); - handler->GetSession()->GetPlayer()->SetWaterWalking(true); // ON + handler->GetSession()->GetPlayer()->SetWaterWalking(true); // ON handler->SendSysMessage("Waterwalking is ON. You can walk on water."); } else { handler->GetSession()->GetPlayer()->SetCommandStatusOff(CHEAT_WATERWALK); - handler->GetSession()->GetPlayer()->SetWaterWalking(false); // OFF + handler->GetSession()->GetPlayer()->SetWaterWalking(false); // OFF handler->SendSysMessage("Waterwalking is OFF. You can't walk on water."); } diff --git a/src/server/scripts/Commands/cs_debug.cpp b/src/server/scripts/Commands/cs_debug.cpp index 7c8bc42f663..cdd03bea274 100644 --- a/src/server/scripts/Commands/cs_debug.cpp +++ b/src/server/scripts/Commands/cs_debug.cpp @@ -1328,7 +1328,9 @@ public: target->SetExtraUnitMovementFlags(*moveFlagsExtra); } - if (moveFlagsExtra || unhandledFlag) + if (target->GetTypeId() != TYPEID_PLAYER) + target->DestroyForNearbyPlayers(); // Force new SMSG_UPDATE_OBJECT:CreateObject + else target->SendMovementFlagUpdate(); handler->PSendSysMessage(LANG_MOVEFLAGS_SET, target->GetUnitMovementFlags(), target->GetExtraUnitMovementFlags()); |