Skip to content

Commit

Permalink
Properly rename the stand state method...
Browse files Browse the repository at this point in the history
  • Loading branch information
Shauren committed Apr 8, 2016
1 parent 6dfc477 commit 3f7e6af
Show file tree
Hide file tree
Showing 9 changed files with 14 additions and 14 deletions.
2 changes: 1 addition & 1 deletion src/server/game/Conditions/ConditionMgr.cpp
Expand Up @@ -440,7 +440,7 @@ bool Condition::Meets(ConditionSourceInfo& sourceInfo) const
if (Unit* unit = object->ToUnit())
{
if (ConditionValue1 == 0)
condMeets = (unit->SetStandState() == ConditionValue2);
condMeets = (unit->GetStandState() == ConditionValue2);
else if (ConditionValue2 == 0)
condMeets = unit->IsStandState();
else if (ConditionValue2 == 1)
Expand Down
4 changes: 2 additions & 2 deletions src/server/game/Entities/GameObject/GameObject.cpp
Expand Up @@ -1282,8 +1282,8 @@ void GameObject::Use(Unit* user)
{
if (Player* ChairUser = ObjectAccessor::FindPlayer(itr->second))
{
if (ChairUser->IsSitState() && ChairUser->SetStandState() != UNIT_STAND_STATE_SIT && ChairUser->GetExactDist2d(x_i, y_i) < 0.1f)
continue; // This seat is already occupied by ChairUser. NOTE: Not sure if the ChairUser->SetStandState() != UNIT_STAND_STATE_SIT check is required.
if (ChairUser->IsSitState() && ChairUser->GetStandState() != UNIT_STAND_STATE_SIT && ChairUser->GetExactDist2d(x_i, y_i) < 0.1f)
continue; // This seat is already occupied by ChairUser. NOTE: Not sure if the ChairUser->GetStandState() != UNIT_STAND_STATE_SIT check is required.
else
itr->second.Clear(); // This seat is unoccupied.
}
Expand Down
4 changes: 2 additions & 2 deletions src/server/game/Entities/Unit/Unit.cpp
Expand Up @@ -14723,7 +14723,7 @@ void Unit::SendMovementFlagUpdate(bool self /* = false */)

bool Unit::IsSitState() const
{
uint8 s = SetStandState();
uint8 s = GetStandState();
return
s == UNIT_STAND_STATE_SIT_CHAIR || s == UNIT_STAND_STATE_SIT_LOW_CHAIR ||
s == UNIT_STAND_STATE_SIT_MEDIUM_CHAIR || s == UNIT_STAND_STATE_SIT_HIGH_CHAIR ||
Expand All @@ -14732,7 +14732,7 @@ bool Unit::IsSitState() const

bool Unit::IsStandState() const
{
uint8 s = SetStandState();
uint8 s = GetStandState();
return !IsSitState() && s != UNIT_STAND_STATE_SLEEP && s != UNIT_STAND_STATE_KNEEL;
}

Expand Down
2 changes: 1 addition & 1 deletion src/server/game/Entities/Unit/Unit.h
Expand Up @@ -1388,7 +1388,7 @@ class TC_GAME_API Unit : public WorldObject
uint32 GetCreatureType() const;
uint32 GetCreatureTypeMask() const;

uint8 SetStandState() const { return GetByteValue(UNIT_FIELD_BYTES_1, 0); }
uint8 GetStandState() const { return GetByteValue(UNIT_FIELD_BYTES_1, 0); }
bool IsSitState() const;
bool IsStandState() const;
void SetStandState(uint8 state);
Expand Down
2 changes: 1 addition & 1 deletion src/server/game/Handlers/CharacterHandler.cpp
Expand Up @@ -1265,7 +1265,7 @@ void WorldSession::HandleAlterAppearance(WorldPacket& recvData)
return;
}

if (_player->SetStandState() != UNIT_STAND_STATE_SIT_LOW_CHAIR + go->GetGOInfo()->barberChair.chairheight)
if (_player->GetStandState() != UNIT_STAND_STATE_SIT_LOW_CHAIR + go->GetGOInfo()->barberChair.chairheight)
{
SendBarberShopResult(BARBER_SHOP_RESULT_NOT_ON_CHAIR);
return;
Expand Down
2 changes: 1 addition & 1 deletion src/server/game/Handlers/MiscHandler.cpp
Expand Up @@ -405,7 +405,7 @@ void WorldSession::HandleLogoutRequestOpcode(WorldPacket& /*recvData*/)
// not set flags if player can't free move to prevent lost state at logout cancel
if (GetPlayer()->CanFreeMove())
{
if (GetPlayer()->SetStandState() == UNIT_STAND_STATE_STAND)
if (GetPlayer()->GetStandState() == UNIT_STAND_STATE_STAND)
GetPlayer()->SetStandState(UNIT_STAND_STATE_SIT);

WorldPacket data(SMSG_FORCE_MOVE_ROOT, (8+4)); // guess size
Expand Down
2 changes: 1 addition & 1 deletion src/server/scripts/Kalimdor/zone_the_barrens.cpp
Expand Up @@ -552,7 +552,7 @@ class npc_wizzlecrank_shredder : public CreatureScript
{
if (!HasEscortState(STATE_ESCORT_ESCORTING))
{
if (me->SetStandState() == UNIT_STAND_STATE_DEAD)
if (me->GetStandState() == UNIT_STAND_STATE_DEAD)
me->SetStandState(UNIT_STAND_STATE_STAND);

IsPostEvent = false;
Expand Down
6 changes: 3 additions & 3 deletions src/server/scripts/Northrend/Ulduar/Ulduar/boss_mimiron.cpp
Expand Up @@ -359,9 +359,9 @@ static bool IsEncounterFinished(Unit* who)
if (!mkii || !vx001 || !aerial)
return false;

if (mkii->SetStandState() == UNIT_STAND_STATE_DEAD &&
vx001->SetStandState() == UNIT_STAND_STATE_DEAD &&
aerial->SetStandState() == UNIT_STAND_STATE_DEAD)
if (mkii->GetStandState() == UNIT_STAND_STATE_DEAD &&
vx001->GetStandState() == UNIT_STAND_STATE_DEAD &&
aerial->GetStandState() == UNIT_STAND_STATE_DEAD)
{
who->Kill(mkii);
who->Kill(vx001);
Expand Down
4 changes: 2 additions & 2 deletions src/server/scripts/Spells/spell_holiday.cpp
Expand Up @@ -65,7 +65,7 @@ class spell_love_is_in_the_air_romantic_picnic : public SpellScriptLoader
Unit* caster = GetCaster();

// If our player is no longer sit, remove all auras
if (target->SetStandState() != UNIT_STAND_STATE_SIT)
if (target->GetStandState() != UNIT_STAND_STATE_SIT)
{
target->RemoveAura(SPELL_ROMANTIC_PICNIC_ACHIEV);
target->RemoveAura(GetAura());
Expand All @@ -84,7 +84,7 @@ class spell_love_is_in_the_air_romantic_picnic : public SpellScriptLoader
target->VisitNearbyWorldObject(INTERACTION_DISTANCE*2, searcher);
for (std::list<Player*>::const_iterator itr = playerList.begin(); itr != playerList.end(); ++itr)
{
if ((*itr) != target && (*itr)->HasAura(GetId())) // && (*itr)->SetStandState() == UNIT_STAND_STATE_SIT)
if ((*itr) != target && (*itr)->HasAura(GetId())) // && (*itr)->GetStandState() == UNIT_STAND_STATE_SIT)
{
if (caster)
{
Expand Down

0 comments on commit 3f7e6af

Please sign in to comment.