mirror of
https://github.com/TrinityCore/TrinityCore.git
synced 2026-01-16 07:30:42 +01:00
Core/Player: moved indoors/outdoors aura interrupting mechanic into heartbeat and movement handling
This commit is contained in:
@@ -1164,6 +1164,9 @@ void Player::Heartbeat()
|
||||
|
||||
// Group update
|
||||
SendUpdateToOutOfRangeGroupMembers();
|
||||
|
||||
// Indoor/Outdoor aura requirements
|
||||
CheckOutdoorsAuraRequirements();
|
||||
}
|
||||
|
||||
void Player::setDeathState(DeathState s)
|
||||
@@ -6274,7 +6277,7 @@ bool Player::UpdatePosition(float x, float y, float z, float orientation, bool t
|
||||
if (GetGroup())
|
||||
SetGroupUpdateFlag(GROUP_UPDATE_FLAG_POSITION);
|
||||
|
||||
CheckAreaExploreAndOutdoor();
|
||||
CheckAreaExplore();
|
||||
|
||||
return true;
|
||||
}
|
||||
@@ -6333,7 +6336,7 @@ void Player::SendMovieStart(uint32 movieId)
|
||||
SendDirectMessage(packet.Write());
|
||||
}
|
||||
|
||||
void Player::CheckAreaExploreAndOutdoor()
|
||||
void Player::CheckAreaExplore()
|
||||
{
|
||||
if (!IsAlive())
|
||||
return;
|
||||
@@ -6341,9 +6344,6 @@ void Player::CheckAreaExploreAndOutdoor()
|
||||
if (IsInFlight())
|
||||
return;
|
||||
|
||||
if (sWorld->getBoolConfig(CONFIG_VMAP_INDOOR_CHECK))
|
||||
RemoveAurasWithAttribute(IsOutdoors() ? SPELL_ATTR0_ONLY_INDOORS : SPELL_ATTR0_ONLY_OUTDOORS);
|
||||
|
||||
uint32 const areaId = GetAreaId();
|
||||
if (!areaId)
|
||||
return;
|
||||
@@ -6441,6 +6441,12 @@ bool Player::HasExploredZone(uint32 areaId) const
|
||||
return (m_activePlayerData->DataFlags[PLAYER_DATA_FLAG_EXPLORED_ZONES_INDEX][playerIndexOffset] & mask) != 0;
|
||||
}
|
||||
|
||||
void Player::CheckOutdoorsAuraRequirements()
|
||||
{
|
||||
if (sWorld->getBoolConfig(CONFIG_VMAP_INDOOR_CHECK))
|
||||
RemoveAurasWithAttribute(IsOutdoors() ? SPELL_ATTR0_ONLY_INDOORS : SPELL_ATTR0_ONLY_OUTDOORS);
|
||||
}
|
||||
|
||||
Team Player::TeamForRace(uint8 race)
|
||||
{
|
||||
if (ChrRacesEntry const* rEntry = sChrRacesStore.LookupEntry(race))
|
||||
|
||||
@@ -2232,11 +2232,13 @@ class TC_GAME_API Player final : public Unit, public GridObject<Player>
|
||||
void SetSemaphoreTeleportFar(bool semphsetting) { mSemaphoreTeleport_Far = semphsetting; }
|
||||
void ProcessDelayedOperations();
|
||||
|
||||
void CheckAreaExploreAndOutdoor(void);
|
||||
void CheckAreaExplore();
|
||||
void AddExploredZones(uint32 pos, uint64 mask);
|
||||
void RemoveExploredZones(uint32 pos, uint64 mask);
|
||||
bool HasExploredZone(uint32 areaId) const;
|
||||
|
||||
void CheckOutdoorsAuraRequirements();
|
||||
|
||||
static Team TeamForRace(uint8 race);
|
||||
static TeamId TeamIdForRace(uint8 race);
|
||||
static uint8 GetFactionGroupForRace(uint8 race);
|
||||
|
||||
@@ -471,6 +471,23 @@ void WorldSession::HandleMovementOpcode(OpcodeClient opcode, MovementInfo& movem
|
||||
plrMover->RemoveAurasWithInterruptFlags(SpellAuraInterruptFlags2::Jump);
|
||||
Unit::ProcSkillsAndAuras(plrMover, nullptr, PROC_FLAG_JUMP, PROC_FLAG_NONE, PROC_SPELL_TYPE_MASK_ALL, PROC_SPELL_PHASE_NONE, PROC_HIT_NONE, nullptr, nullptr, nullptr);
|
||||
}
|
||||
|
||||
// Whenever a player stops a movement action, an indoor/outdoor check is being performed
|
||||
switch (opcode)
|
||||
{
|
||||
case CMSG_MOVE_SET_FLY:
|
||||
case CMSG_MOVE_FALL_LAND:
|
||||
case CMSG_MOVE_STOP:
|
||||
case CMSG_MOVE_STOP_STRAFE:
|
||||
case CMSG_MOVE_STOP_TURN:
|
||||
case CMSG_MOVE_STOP_SWIM:
|
||||
case CMSG_MOVE_STOP_PITCH:
|
||||
case CMSG_MOVE_STOP_ASCEND:
|
||||
plrMover->CheckOutdoorsAuraRequirements();
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user