Skip to content

Commit

Permalink
Rename deprecated flag UNIT_FLAG_DISABLE_MOVE
Browse files Browse the repository at this point in the history
  • Loading branch information
Warlockbugs committed Jun 20, 2017
1 parent 7699a66 commit 2032cfb
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions src/game/Entities/Player.cpp
Expand Up @@ -2781,7 +2781,7 @@ void Player::InitStatsForLevel(bool reapplyMods)

// cleanup unit flags (will be re-applied if need at aura load).
RemoveFlag(UNIT_FIELD_FLAGS,
UNIT_FLAG_NON_ATTACKABLE | UNIT_FLAG_DISABLE_MOVE | UNIT_FLAG_NOT_ATTACKABLE_1 |
UNIT_FLAG_NON_ATTACKABLE | UNIT_FLAG_NON_MOVING_DEPRECATED | UNIT_FLAG_NOT_ATTACKABLE_1 |
UNIT_FLAG_OOC_NOT_ATTACKABLE | UNIT_FLAG_PASSIVE | UNIT_FLAG_LOOTING |
UNIT_FLAG_PET_IN_COMBAT | UNIT_FLAG_SILENCED | UNIT_FLAG_PACIFIED |
UNIT_FLAG_STUNNED | UNIT_FLAG_IN_COMBAT | UNIT_FLAG_DISARMED |
Expand Down Expand Up @@ -18696,7 +18696,7 @@ bool Player::ActivateTaxiPathTo(std::vector<uint32> const& nodes, Creature* npc
return false;
}

if (HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_DISABLE_MOVE))
if (HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_MOVING_DEPRECATED))
return false;

// taximaster case
Expand Down
2 changes: 1 addition & 1 deletion src/game/Entities/Unit.h
Expand Up @@ -558,7 +558,7 @@ enum UnitFlags
{
UNIT_FLAG_UNK_0 = 0x00000001,
UNIT_FLAG_NON_ATTACKABLE = 0x00000002, // not attackable
UNIT_FLAG_DISABLE_MOVE = 0x00000004,
UNIT_FLAG_NON_MOVING_DEPRECATED = 0x00000004, // TODO: Needs research
UNIT_FLAG_PVP_ATTACKABLE = 0x00000008, // allow apply pvp rules to attackable state in addition to faction dependent state
UNIT_FLAG_RENAME = 0x00000010,
UNIT_FLAG_PREPARATION = 0x00000020, // don't take reagents for spells with SPELL_ATTR_EX5_NO_REAGENT_WHILE_PREP
Expand Down
4 changes: 2 additions & 2 deletions src/game/MotionGenerators/WaypointMovementGenerator.cpp
Expand Up @@ -382,7 +382,7 @@ void FlightPathMovementGenerator::Finalize(Player& player)
player.clearUnitState(UNIT_STAT_TAXI_FLIGHT);

player.Unmount();
player.RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_DISABLE_MOVE | UNIT_FLAG_TAXI_FLIGHT);
player.RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_MOVING_DEPRECATED | UNIT_FLAG_TAXI_FLIGHT);
player.SetClientControl(&player, 1);

if (player.m_taxi.empty())
Expand All @@ -409,7 +409,7 @@ void FlightPathMovementGenerator::Reset(Player& player)
{
player.getHostileRefManager().setOnlineOfflineState(false);
player.addUnitState(UNIT_STAT_TAXI_FLIGHT);
player.SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_DISABLE_MOVE | UNIT_FLAG_TAXI_FLIGHT);
player.SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_MOVING_DEPRECATED | UNIT_FLAG_TAXI_FLIGHT);
player.SetClientControl(&player, 0);

Movement::MoveSplineInit init(player);
Expand Down

5 comments on commit 2032cfb

@boxa
Copy link
Contributor

@boxa boxa commented on 2032cfb Jun 20, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

already researched: UNIT_FLAG_REMOVE_CLIENT_CONTROL (formerly UNIT_FLAG_DISABLE_MOVE) is a client-only feature that should not be used for NPC scripting

need port it from TC:
TrinityCore/TrinityCore#17311
TrinityCore/TrinityCore@061b62a

TrinityCore/TrinityCore#17543
Aokromes/TrinityCore@9c13a84

@Warlockbugs
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is insufficient and just confirms that naming is incorrect, no concrete info on what this flag is actually doing. From client side i can confirm that it shares movement limits lifting capability with a plethora of CC flags, but that is all there is to it for now.

@Shauren
Copy link
Contributor

@Shauren Shauren commented on 2032cfb Jun 20, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The comment I left in TrinityCore source for this flag is the concrete info on what this flag is actually doing (meant to do in past) - opcode 0x159 handler in 12340 client has the same code (call chain: packet handler, sub_72CCA0, sub_520FE0 (also known as CGGameUI::OnClientControlChanged)) that CGUnit_C::OnFlagChanged in the 1.0.0.3368 named alpha client had (CGGameUI::OnClientControlChanged)

@Warlockbugs
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The potential presence of this flag on creatures coming from live server is what concerning me. If its found only on reasonably old creatures (vanilla->tbc, since tbc development started in 2005), could be a legacy/deprecation issue. If its met on newer creatures as well, its likely a dual-use flag and we don't know the real meaning yet.
I don't think we can trust our databases on this matter, since it could be prone to intentional misuse pollution.

@Shauren
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have not seen it myself on any creature (ever) but I'm working on researching latest clients - the documented use is the only use of it in current live client (movement/emotes)

Please sign in to comment.