Apply style fix pt3

This commit is contained in:
Antz 2020-01-13 10:14:05 +00:00
parent 1392c131e7
commit d93dbd95fe
191 changed files with 9851 additions and 676 deletions

View file

@ -253,7 +253,9 @@ bool GameObject::Create(uint32 guidlow, uint32 name_id, Map* map, uint32 phaseMa
((BattleGroundMap*)map)->GetBG()->HandleGameObjectCreate(this);
}
else if (OutdoorPvP* outdoorPvP = sOutdoorPvPMgr.GetScript(GetZoneId()))
{ outdoorPvP->HandleGameObjectCreate(this); }
{
outdoorPvP->HandleGameObjectCreate(this);
}
// Notify the map's instance data.
// Only works if you create the object in it, not if it is moves to that map.
@ -539,7 +541,9 @@ void GameObject::Update(uint32 update_diff, uint32 p_time)
SetUInt32Value(GAMEOBJECT_FLAGS, (GetGOInfo()->flags & ~(GO_FLAG_LOCKED | GO_FLAG_INTERACT_COND | GO_FLAG_NO_INTERACT)) | currentLockOrInteractFlags);
}
else
{ SetUInt32Value(GAMEOBJECT_FLAGS, GetGOInfo()->flags); }
{
SetUInt32Value(GAMEOBJECT_FLAGS, GetGOInfo()->flags);
}
}
loot.clear();
@ -615,7 +619,9 @@ void GameObject::Delete()
sPoolMgr.UpdatePool<GameObject>(*GetMap()->GetPersistentState(), poolid, GetGUIDLow());
}
else
{ AddObjectToRemoveList(); }
{
AddObjectToRemoveList();
}
}
void GameObject::SaveToDB()
@ -845,7 +851,9 @@ bool GameObject::isVisibleForInState(Player const* u, WorldObject const* viewPoi
// invisible at client always
if (!GetGOInfo()->displayId)
{
return false;
}
// Transport always visible at this step implementation
if (IsTransport() && IsInMap(u))
@ -881,14 +889,18 @@ bool GameObject::isVisibleForInState(Player const* u, WorldObject const* viewPoi
else
{
if (u->IsFriendlyTo(owner))
{
return true;
}
}
}
// handle environment traps (spawned by DB)
else
{
if (this->IsFriendlyTo(u))
{
return true;
}
else
trapNotVisible = true;
}
@ -897,11 +909,15 @@ bool GameObject::isVisibleForInState(Player const* u, WorldObject const* viewPoi
if (Aura* aura = ((Player*)u)->GetAura(2836, EFFECT_INDEX_0))
{
if (roll_chance_i(aura->GetModifier()->m_amount) && u->IsInFront(this, 15.0f))
{
return true;
}
}
if (trapNotVisible)
{
return false;
}
}
}
@ -1156,14 +1172,18 @@ void GameObject::SwitchDoorOrButton(bool activate, bool alternative /* = false *
SetFlag(GAMEOBJECT_FLAGS, GO_FLAG_IN_USE);
}
else
{ RemoveFlag(GAMEOBJECT_FLAGS, GO_FLAG_IN_USE); }
{
RemoveFlag(GAMEOBJECT_FLAGS, GO_FLAG_IN_USE);
}
if (GetGoState() == GO_STATE_READY) // if closed -> open
{
SetGoState(alternative ? GO_STATE_ACTIVE_ALTERNATIVE : GO_STATE_ACTIVE);
}
else // if open -> close
{ SetGoState(GO_STATE_READY); }
{
SetGoState(GO_STATE_READY);
}
}
void GameObject::Use(Unit* user)
@ -1412,7 +1432,9 @@ void GameObject::Use(Unit* user)
SendGameObjectCustomAnim(GetObjectGuid());
}
else
{ SetGoState(GO_STATE_ACTIVE); }
{
SetGoState(GO_STATE_ACTIVE);
}
m_cooldownTime = time(NULL) + info->GetAutoCloseTime();
@ -1460,7 +1482,9 @@ void GameObject::Use(Unit* user)
GetMap()->ScriptsStart(DBS_ON_GO_USE, GetGUIDLow(), spellCaster, this);
}
else
{ return; }
{
return;
}
// cast this spell later if provided
spellId = info->goober.spellId;
@ -1587,7 +1611,9 @@ void GameObject::Use(Unit* user)
SetLootState(GO_JUST_DEACTIVATED);
}
else
{ player->SendLoot(GetObjectGuid(), success ? LOOT_FISHING : LOOT_FISHING_FAIL); }
{
player->SendLoot(GetObjectGuid(), success ? LOOT_FISHING : LOOT_FISHING_FAIL);
}
}
else
{
@ -1661,7 +1687,9 @@ void GameObject::Use(Unit* user)
}
}
else
{ return; }
{
return;
}
}
spellCaster = player;
@ -1712,7 +1740,9 @@ void GameObject::Use(Unit* user)
}
// reset ritual for this GO
else
{ ClearAllUsesData(); }
{
ClearAllUsesData();
}
// go to end function to spell casting
break;
@ -1879,10 +1909,14 @@ void GameObject::Use(Unit* user)
{
GameObjectInfo const* info = GetGOInfo();
if (!info)
{
return;
}
if (user->GetTypeId() != TYPEID_PLAYER)
{
return;
}
Player* player = (Player*)user;
@ -2379,13 +2413,21 @@ void GameObject::SetCapturePointSlider(float value, bool isLocked)
m_captureState = CAPTURE_STATE_WIN_ALLIANCE;
}
else if ((int)m_captureSlider == CAPTURE_SLIDER_HORDE)
{ m_captureState = CAPTURE_STATE_WIN_HORDE; }
{
m_captureState = CAPTURE_STATE_WIN_HORDE;
}
else if (m_captureSlider > CAPTURE_SLIDER_MIDDLE + info->capturePoint.neutralPercent * 0.5f)
{ m_captureState = CAPTURE_STATE_PROGRESS_ALLIANCE; }
{
m_captureState = CAPTURE_STATE_PROGRESS_ALLIANCE;
}
else if (m_captureSlider < CAPTURE_SLIDER_MIDDLE - info->capturePoint.neutralPercent * 0.5f)
{ m_captureState = CAPTURE_STATE_PROGRESS_HORDE; }
{
m_captureState = CAPTURE_STATE_PROGRESS_HORDE;
}
else
{ m_captureState = CAPTURE_STATE_NEUTRAL; }
{
m_captureState = CAPTURE_STATE_NEUTRAL;
}
}
void GameObject::TickCapturePoint()
@ -2413,7 +2455,9 @@ void GameObject::TickCapturePoint()
++rangePlayers;
}
else
{ --rangePlayers; }
{
--rangePlayers;
}
ObjectGuid guid = (*itr)->GetObjectGuid();
if (!tempUsers.erase(guid))
@ -2462,7 +2506,9 @@ void GameObject::TickCapturePoint()
rangePlayers = maxSuperiority;
}
else if (rangePlayers < -maxSuperiority)
{ rangePlayers = -maxSuperiority; }
{
rangePlayers = -maxSuperiority;
}
// time to capture from 0% to 100% is maxTime for minSuperiority amount of players and minTime for maxSuperiority amount of players (linear function: y = dy/dx*x+d)
float deltaSlider = info->capturePoint.minTime;
@ -2597,7 +2643,9 @@ void GameObject::DealGameObjectDamage(uint32 damage, uint32 spell, Unit* caster)
MANGOS_ASSERT(spell && sSpellStore.LookupEntry(spell) && caster);
if (!damage)
{
return;
}
ForceGameObjectHealth(-int32(damage), caster);