Core/Units: Renamed and documented UNIT_FLAG_DISABLE_MOVE to prevent people from trying to use this flag to root a creature leaving them wondering why it doesn't do anything
This commit is contained in:
1 parent
d716e6049a
commit
e58f0e805c
8 files changed
+17
-17
No files matched your search
@@ -142,8 +142,8 @@ void BattlegroundIC::PostUpdateImpl(uint32 diff)
|
||||
{
|
||||
if (siege->IsAlive())
|
||||
{
|
||||
if (siege->HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE|UNIT_FLAG_UNK_14|UNIT_FLAG_IMMUNE_TO_PC))
|
||||
// following sniffs the vehicle always has UNIT_FLAG_UNK_14
|
||||
if (siege->HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE|UNIT_FLAG_CANNOT_SWIM|UNIT_FLAG_IMMUNE_TO_PC))
|
||||
// following sniffs the vehicle always has UNIT_FLAG_CANNOT_SWIM
|
||||
siege->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE|UNIT_FLAG_IMMUNE_TO_PC);
|
||||
else
|
||||
siege->SetHealth(siege->GetMaxHealth());
|
||||
@@ -762,7 +762,7 @@ void BattlegroundIC::HandleCapturedNodes(ICNodePoint* node, bool recapture)
|
||||
|
||||
if (Creature* siegeEngine = GetBGCreature(siegeType))
|
||||
{
|
||||
siegeEngine->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE|UNIT_FLAG_UNK_14|UNIT_FLAG_IMMUNE_TO_PC);
|
||||
siegeEngine->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE|UNIT_FLAG_CANNOT_SWIM|UNIT_FLAG_IMMUNE_TO_PC);
|
||||
siegeEngine->setFaction(BG_IC_Factions[(node->faction == TEAM_ALLIANCE ? 0 : 1)]);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3092,7 +3092,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_REMOVE_CLIENT_CONTROL | UNIT_FLAG_NOT_ATTACKABLE_1 |
|
||||
UNIT_FLAG_IMMUNE_TO_PC | UNIT_FLAG_IMMUNE_TO_NPC | UNIT_FLAG_LOOTING |
|
||||
UNIT_FLAG_PET_IN_COMBAT | UNIT_FLAG_SILENCED | UNIT_FLAG_PACIFIED |
|
||||
UNIT_FLAG_STUNNED | UNIT_FLAG_IN_COMBAT | UNIT_FLAG_DISARMED |
|
||||
@@ -21312,7 +21312,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_REMOVE_CLIENT_CONTROL))
|
||||
return false;
|
||||
|
||||
// taximaster case
|
||||
@@ -21511,7 +21511,7 @@ void Player::CleanupAfterTaxiFlight()
|
||||
{
|
||||
m_taxi.ClearTaxiDestinations(); // not destinations, clear source node
|
||||
Dismount();
|
||||
RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_DISABLE_MOVE | UNIT_FLAG_TAXI_FLIGHT);
|
||||
RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_REMOVE_CLIENT_CONTROL | UNIT_FLAG_TAXI_FLIGHT);
|
||||
getHostileRefManager().setOnlineOfflineState(true);
|
||||
}
|
||||
|
||||
|
||||
@@ -14586,7 +14586,7 @@ bool Unit::SetCharmedBy(Unit* charmer, CharmType type, AuraApplication const* au
|
||||
case CHARM_TYPE_POSSESS:
|
||||
AddUnitState(UNIT_STATE_POSSESSED);
|
||||
SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_PLAYER_CONTROLLED);
|
||||
charmer->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_DISABLE_MOVE);
|
||||
charmer->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_REMOVE_CLIENT_CONTROL);
|
||||
playerCharmer->SetClientControl(this, true);
|
||||
playerCharmer->PossessSpellInitialize();
|
||||
break;
|
||||
@@ -14689,7 +14689,7 @@ void Unit::RemoveCharmedBy(Unit* charmer)
|
||||
case CHARM_TYPE_POSSESS:
|
||||
playerCharmer->SetClientControl(this, false);
|
||||
playerCharmer->SetClientControl(charmer, true);
|
||||
charmer->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_DISABLE_MOVE);
|
||||
charmer->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_REMOVE_CLIENT_CONTROL);
|
||||
RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_PLAYER_CONTROLLED);
|
||||
ClearUnitState(UNIT_STATE_POSSESSED);
|
||||
break;
|
||||
|
||||
@@ -627,7 +627,7 @@ enum UnitFlags : uint32
|
||||
{
|
||||
UNIT_FLAG_SERVER_CONTROLLED = 0x00000001, // set only when unit movement is controlled by server - by SPLINE/MONSTER_MOVE packets, together with UNIT_FLAG_STUNNED; only set to units controlled by client; client function CGUnit_C::IsClientControlled returns false when set for owner
|
||||
UNIT_FLAG_NON_ATTACKABLE = 0x00000002, // not attackable
|
||||
UNIT_FLAG_DISABLE_MOVE = 0x00000004,
|
||||
UNIT_FLAG_REMOVE_CLIENT_CONTROL = 0x00000004, // This is a legacy flag used to disable movement player's movement while controlling other units, SMSG_CLIENT_CONTROL replaces this functionality clientside now. CONFUSED and FLEEING flags have the same effect on client movement asDISABLE_MOVE_CONTROL in addition to preventing spell casts/autoattack (they all allow climbing steeper hills and emotes while moving)
|
||||
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_ATTR5_NO_REAGENT_WHILE_PREP
|
||||
@@ -639,7 +639,7 @@ enum UnitFlags : uint32
|
||||
UNIT_FLAG_PET_IN_COMBAT = 0x00000800, // in combat?, 2.0.8
|
||||
UNIT_FLAG_PVP = 0x00001000, // changed in 3.0.3
|
||||
UNIT_FLAG_SILENCED = 0x00002000, // silenced, 2.1.1
|
||||
UNIT_FLAG_UNK_14 = 0x00004000, // 2.0.8
|
||||
UNIT_FLAG_CANNOT_SWIM = 0x00004000, // 2.0.8
|
||||
UNIT_FLAG_UNK_15 = 0x00008000,
|
||||
UNIT_FLAG_UNK_16 = 0x00010000,
|
||||
UNIT_FLAG_PACIFIED = 0x00020000, // 3.0.3 ok
|
||||
|
||||
@@ -241,7 +241,7 @@ void MotionMaster::MoveConfused()
|
||||
void MotionMaster::MoveChase(Unit* target, float dist, float angle)
|
||||
{
|
||||
// ignore movement request if target not exist
|
||||
if (!target || target == _owner || _owner->HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_DISABLE_MOVE))
|
||||
if (!target || target == _owner)
|
||||
return;
|
||||
|
||||
//_owner->ClearUnitState(UNIT_STATE_FOLLOW);
|
||||
@@ -266,7 +266,7 @@ void MotionMaster::MoveChase(Unit* target, float dist, float angle)
|
||||
void MotionMaster::MoveFollow(Unit* target, float dist, float angle, MovementSlot slot)
|
||||
{
|
||||
// ignore movement request if target not exist
|
||||
if (!target || target == _owner || _owner->HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_DISABLE_MOVE))
|
||||
if (!target || target == _owner)
|
||||
return;
|
||||
|
||||
//_owner->AddUnitState(UNIT_STATE_FOLLOW);
|
||||
|
||||
@@ -315,7 +315,7 @@ void FlightPathMovementGenerator::DoFinalize(Player* player)
|
||||
player->ClearUnitState(UNIT_STATE_IN_FLIGHT);
|
||||
|
||||
player->Dismount();
|
||||
player->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_DISABLE_MOVE | UNIT_FLAG_TAXI_FLIGHT);
|
||||
player->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_REMOVE_CLIENT_CONTROL | UNIT_FLAG_TAXI_FLIGHT);
|
||||
|
||||
if (player->m_taxi.empty())
|
||||
{
|
||||
@@ -335,7 +335,7 @@ void FlightPathMovementGenerator::DoReset(Player* player)
|
||||
{
|
||||
player->getHostileRefManager().setOnlineOfflineState(false);
|
||||
player->AddUnitState(UNIT_STATE_IN_FLIGHT);
|
||||
player->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_DISABLE_MOVE | UNIT_FLAG_TAXI_FLIGHT);
|
||||
player->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_REMOVE_CLIENT_CONTROL | UNIT_FLAG_TAXI_FLIGHT);
|
||||
|
||||
Movement::MoveSplineInit init(player);
|
||||
uint32 end = GetPathAtMapEnd();
|
||||
|
||||
@@ -114,7 +114,7 @@ EnumName<UnitFlags> const unitFlags[MAX_UNIT_FLAGS] =
|
||||
{
|
||||
CREATE_NAMED_ENUM(UNIT_FLAG_SERVER_CONTROLLED),
|
||||
CREATE_NAMED_ENUM(UNIT_FLAG_NON_ATTACKABLE),
|
||||
CREATE_NAMED_ENUM(UNIT_FLAG_DISABLE_MOVE),
|
||||
CREATE_NAMED_ENUM(UNIT_FLAG_REMOVE_CLIENT_CONTROL),
|
||||
CREATE_NAMED_ENUM(UNIT_FLAG_PVP_ATTACKABLE),
|
||||
CREATE_NAMED_ENUM(UNIT_FLAG_RENAME),
|
||||
CREATE_NAMED_ENUM(UNIT_FLAG_PREPARATION),
|
||||
@@ -126,7 +126,7 @@ EnumName<UnitFlags> const unitFlags[MAX_UNIT_FLAGS] =
|
||||
CREATE_NAMED_ENUM(UNIT_FLAG_PET_IN_COMBAT),
|
||||
CREATE_NAMED_ENUM(UNIT_FLAG_PVP),
|
||||
CREATE_NAMED_ENUM(UNIT_FLAG_SILENCED),
|
||||
CREATE_NAMED_ENUM(UNIT_FLAG_UNK_14),
|
||||
CREATE_NAMED_ENUM(UNIT_FLAG_CANNOT_SWIM),
|
||||
CREATE_NAMED_ENUM(UNIT_FLAG_UNK_15),
|
||||
CREATE_NAMED_ENUM(UNIT_FLAG_UNK_16),
|
||||
CREATE_NAMED_ENUM(UNIT_FLAG_PACIFIED),
|
||||
|
||||
@@ -1927,7 +1927,7 @@ class spell_gen_mounted_charge: public SpellScriptLoader
|
||||
}
|
||||
|
||||
// If target isn't a training dummy there's a chance of failing the charge
|
||||
if (!target->HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_DISABLE_MOVE) && roll_chance_f(12.5f))
|
||||
if (!target->IsCharmedOwnedByPlayerOrPlayer() && roll_chance_f(12.5f))
|
||||
spellId = SPELL_CHARGE_MISS_EFFECT;
|
||||
|
||||
if (Unit* vehicle = GetCaster()->GetVehicleBase())
|
||||
|
||||
Reference in new issue
Block a user