Merge pull request #12204 from Trisjdc/map_enter
Core/Maps: Allow logging players to enter in instances that have an encounter in progress
This commit is contained in:
@@ -26759,3 +26759,8 @@ Pet* Player::SummonPet(uint32 entry, float x, float y, float z, float ang, PetTy
|
||||
|
||||
return pet;
|
||||
}
|
||||
|
||||
bool Player::IsLoading() const
|
||||
{
|
||||
return GetSession()->PlayerLoading();
|
||||
}
|
||||
|
||||
@@ -2303,6 +2303,8 @@ class Player : public Unit, public GridObject<Player>
|
||||
std::string GetMapAreaAndZoneString();
|
||||
std::string GetCoordsMapAreaAndZoneString();
|
||||
|
||||
bool IsLoading() const;
|
||||
|
||||
protected:
|
||||
// Gamemaster whisper whitelist
|
||||
WhisperListContainer WhisperList;
|
||||
|
||||
@@ -2854,10 +2854,9 @@ bool InstanceMap::CanEnter(Player* player)
|
||||
return false;
|
||||
}
|
||||
|
||||
// cannot enter while an encounter is in progress on raids
|
||||
/*Group* group = player->GetGroup();
|
||||
if (!player->IsGameMaster() && group && group->InCombatToInstance(GetInstanceId()) && player->GetMapId() != GetId())*/
|
||||
if (IsRaid() && GetInstanceScript() && GetInstanceScript()->IsEncounterInProgress())
|
||||
// cannot enter while an encounter is in progress
|
||||
// allow if just loading
|
||||
if (!player->IsLoading() && IsRaid() && GetInstanceScript() && GetInstanceScript()->IsEncounterInProgress())
|
||||
{
|
||||
player->SendTransferAborted(GetId(), TRANSFER_ABORT_ZONE_IN_COMBAT);
|
||||
return false;
|
||||
|
||||
Reference in New Issue
Block a user