mirror of
https://github.com/mangosfour/server.git
synced 2025-12-14 16:37:01 +00:00
[10298] Clear tavern rest when leaving building and prevent forced unmount when in GM mode.
This commit is contained in:
parent
af50d03f16
commit
28d1ac66c3
3 changed files with 19 additions and 17 deletions
|
|
@ -6127,7 +6127,19 @@ void Player::CheckAreaExploreAndOutdoor()
|
|||
bool isOutdoor;
|
||||
uint16 areaFlag = GetBaseMap()->GetAreaFlag(GetPositionX(),GetPositionY(),GetPositionZ(), &isOutdoor);
|
||||
|
||||
if (sWorld.getConfig(CONFIG_BOOL_VMAP_INDOOR_CHECK) && !isOutdoor)
|
||||
if (isOutdoor)
|
||||
{
|
||||
if (HasFlag(PLAYER_FLAGS, PLAYER_FLAGS_RESTING) && GetRestType() == REST_TYPE_IN_TAVERN)
|
||||
{
|
||||
AreaTriggerEntry const* at = sAreaTriggerStore.LookupEntry(inn_trigger_id);
|
||||
if (!at || !IsPointInAreaTriggerZone(at, GetMapId(), GetPositionX(), GetPositionY(), GetPositionZ()))
|
||||
{
|
||||
// Player left inn (REST_TYPE_IN_CITY overrides REST_TYPE_IN_TAVERN, so just clear rest)
|
||||
SetRestType(REST_TYPE_NO);
|
||||
}
|
||||
}
|
||||
}
|
||||
else if (sWorld.getConfig(CONFIG_BOOL_VMAP_INDOOR_CHECK) && !isGameMaster())
|
||||
RemoveAurasWithAttribute(SPELL_ATTR_OUTDOORS_ONLY);
|
||||
|
||||
if (areaFlag==0xffff)
|
||||
|
|
@ -6738,20 +6750,9 @@ void Player::UpdateZone(uint32 newZone, uint32 newArea)
|
|||
|
||||
if(zone->flags & AREA_FLAG_CAPITAL) // in capital city
|
||||
SetRestType(REST_TYPE_IN_CITY);
|
||||
else // anywhere else
|
||||
{
|
||||
if (HasFlag(PLAYER_FLAGS, PLAYER_FLAGS_RESTING)) // but resting (walk from city or maybe in tavern or leave tavern recently)
|
||||
{
|
||||
if (GetRestType()==REST_TYPE_IN_TAVERN) // has been in tavern. Is still in?
|
||||
{
|
||||
AreaTriggerEntry const* at = sAreaTriggerStore.LookupEntry(inn_trigger_id);
|
||||
if (!at || !IsPointInAreaTriggerZone(at, GetMapId(), GetPositionX(), GetPositionY(), GetPositionY()))
|
||||
else if (HasFlag(PLAYER_FLAGS, PLAYER_FLAGS_RESTING) && GetRestType() != REST_TYPE_IN_TAVERN)
|
||||
// resting and not in tavern (leave city then); tavern leave handled in CheckAreaExploreAndOutdoor
|
||||
SetRestType(REST_TYPE_NO);
|
||||
}
|
||||
else // not in tavern (leave city then)
|
||||
SetRestType(REST_TYPE_NO);
|
||||
}
|
||||
}
|
||||
|
||||
// remove items with area/map limitations (delete only for alive player to allow back in ghost mode)
|
||||
// if player resurrected at teleport this will be applied in resurrect code
|
||||
|
|
|
|||
|
|
@ -4212,7 +4212,8 @@ SpellCastResult Spell::CheckCast(bool strict)
|
|||
if(bg->GetStatus() == STATUS_WAIT_LEAVE)
|
||||
return SPELL_FAILED_DONT_REPORT;
|
||||
|
||||
if(m_caster->GetTypeId() == TYPEID_PLAYER && VMAP::VMapFactory::createOrGetVMapManager()->isLineOfSightCalcEnabled())
|
||||
if(m_caster->GetTypeId() == TYPEID_PLAYER && !((Player*)m_caster)->isGameMaster() &&
|
||||
VMAP::VMapFactory::createOrGetVMapManager()->isLineOfSightCalcEnabled())
|
||||
{
|
||||
if(m_spellInfo->Attributes & SPELL_ATTR_OUTDOORS_ONLY &&
|
||||
!m_caster->GetMap()->IsOutdoors(m_caster->GetPositionX(), m_caster->GetPositionY(), m_caster->GetPositionZ()))
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
#ifndef __REVISION_NR_H__
|
||||
#define __REVISION_NR_H__
|
||||
#define REVISION_NR "10297"
|
||||
#define REVISION_NR "10298"
|
||||
#endif // __REVISION_NR_H__
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue