[CORE 335] Allow flying mounts (aura) for GMs

dokuro

Veteran Member
Verified Member
31
2020
8
Location
Paris
Allow flying mounts (aura) for GMs​

Hello !

If, as GM, you enjoy flying in a flying mount on Azeroth, you may encounter a difficulty when changing area.
Indeed, there is a server-side check that will take you down from the mount, even if you are GM.

Here's how to fix the problem in the core.

In the player.cpp, replace the "CanFlyInZone" method as follows:


bool Player::CanFlyInZone(uint32 mapid, uint32 zone, SpellInfo const* bySpell) const
{

if (IsGameMaster())
return true;

// continent checked in SpellInfo::CheckLocation at cast and area update
uint32 v_map = GetVirtualMapForMapAndZone(mapid, zone);
if (v_map == 571 && !bySpell->HasAttribute(SPELL_ATTR7_IGNORE_COLD_WEATHER_FLYING))
if (!HasSpell(54197)) // 54197 = Cold Weather Flying
return false;

return true;
}

In the SpellInfo.cpp file, in the CheckLocation method, modify the part concerning the limitations by continent as follows:

// continent limitation (virtual continent)
if (HasAttribute(SPELL_ATTR4_CAST_ONLY_IN_OUTLAND))
{
if (strict)
{
AreaTableEntry const* areaEntry = sAreaTableStore.LookupEntry(area_id);
if (!areaEntry)
areaEntry = sAreaTableStore.LookupEntry(zone_id);

if (!areaEntry || !areaEntry->IsFlyable() || !player->CanFlyInZone(map_id, zone_id, this))
return SPELL_FAILED_INCORRECT_AREA;
}
else
{
uint32 const v_map = GetVirtualMapForMapAndZone(map_id, zone_id);
MapEntry const* mapEntry = sMapStore.LookupEntry(v_map);

if(!mapEntry)
return SPELL_FAILED_INCORRECT_AREA;

if (!player->IsGameMaster())
{
if(mapEntry->Expansion() < 1 || !mapEntry->IsContinent())
return SPELL_FAILED_INCORRECT_AREA;
}

//if (!mapEntry || mapEntry->Expansion() < 1 || !mapEntry->IsContinent() || !player->IsGameMaster())
// return SPELL_FAILED_INCORRECT_AREA;
}
}



I specify that I equip my mounts through the command ".aura", you can not go through the classic method (catalog of frames) because there is a verification on the client side.

Hoping it will help someone out someday


enjoy ! =)
 
Top