Skip to content

Commit 77724bf

Browse files
committed
Core/Player: moved indoors/outdoors aura interrupting mechanic into heartbeat and movement handling
(cherry picked from commit 5a169f6eae45a7578d6e312cdba9825f6fc24fa5)
1 parent d8cde00 commit 77724bf

3 files changed

Lines changed: 30 additions & 6 deletions

File tree

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

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1243,6 +1243,9 @@ void Player::Heartbeat()
12431243

12441244
// Group update
12451245
SendUpdateToOutOfRangeGroupMembers();
1246+
1247+
// Indoor/Outdoor aura requirements
1248+
CheckOutdoorsAuraRequirements();
12461249
}
12471250

12481251
void Player::setDeathState(DeathState s)
@@ -6135,7 +6138,7 @@ bool Player::UpdatePosition(float x, float y, float z, float orientation, bool t
61356138
if (GetGroup())
61366139
SetGroupUpdateFlag(GROUP_UPDATE_FLAG_POSITION);
61376140

6138-
CheckAreaExploreAndOutdoor();
6141+
CheckAreaExplore();
61396142

61406143
return true;
61416144
}
@@ -6192,17 +6195,14 @@ void Player::SendMovieStart(uint32 movieId)
61926195
SendDirectMessage(packet.Write());
61936196
}
61946197

6195-
void Player::CheckAreaExploreAndOutdoor()
6198+
void Player::CheckAreaExplore()
61966199
{
61976200
if (!IsAlive())
61986201
return;
61996202

62006203
if (IsInFlight())
62016204
return;
62026205

6203-
if (sWorld->getBoolConfig(CONFIG_VMAP_INDOOR_CHECK) && !IsOutdoors())
6204-
RemoveAurasWithAttribute(SPELL_ATTR0_OUTDOORS_ONLY);
6205-
62066206
uint32 const areaId = GetAreaId();
62076207
if (!areaId)
62086208
return;
@@ -6274,6 +6274,12 @@ void Player::CheckAreaExploreAndOutdoor()
62746274
}
62756275
}
62766276

6277+
void Player::CheckOutdoorsAuraRequirements()
6278+
{
6279+
if (sWorld->getBoolConfig(CONFIG_VMAP_INDOOR_CHECK))
6280+
RemoveAurasWithAttribute(IsOutdoors() ? SPELL_ATTR0_INDOORS_ONLY : SPELL_ATTR0_OUTDOORS_ONLY);
6281+
}
6282+
62776283
uint32 Player::TeamForRace(uint8 race)
62786284
{
62796285
if (ChrRacesEntry const* rEntry = sChrRacesStore.LookupEntry(race))

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

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1830,7 +1830,8 @@ class TC_GAME_API Player : public Unit, public GridObject<Player>
18301830
void SetSemaphoreTeleportFar(bool semphsetting) { mSemaphoreTeleport_Far = semphsetting; }
18311831
void ProcessDelayedOperations();
18321832

1833-
void CheckAreaExploreAndOutdoor(void);
1833+
void CheckAreaExplore();
1834+
void CheckOutdoorsAuraRequirements();
18341835

18351836
static uint32 TeamForRace(uint8 race);
18361837
static TeamId TeamIdForRace(uint8 race);

src/server/game/Handlers/MovementHandler.cpp

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -419,6 +419,23 @@ void WorldSession::HandleMovementOpcodes(WorldPacket& recvPacket)
419419
}
420420
else
421421
plrMover->RemoveFlag(PLAYER_FLAGS, PLAYER_FLAGS_IS_OUT_OF_BOUNDS);
422+
423+
// Whenever a player stops a movement action, an indoor/outdoor check is being performed
424+
switch (opcode)
425+
{
426+
case CMSG_MOVE_SET_FLY:
427+
case MSG_MOVE_FALL_LAND:
428+
case MSG_MOVE_STOP:
429+
case MSG_MOVE_STOP_STRAFE:
430+
case MSG_MOVE_STOP_TURN:
431+
case MSG_MOVE_STOP_SWIM:
432+
case MSG_MOVE_STOP_PITCH:
433+
case MSG_MOVE_STOP_ASCEND:
434+
plrMover->CheckOutdoorsAuraRequirements();
435+
break;
436+
default:
437+
break;
438+
}
422439
}
423440
}
424441

0 commit comments

Comments
 (0)