Core/Creature: fixed falling back to creature_template flag data when not overriden in creature table
*fixed column type of npcflag for creature table
This commit is contained in:
1 parent
bb6a8ac297
commit
34fa3e1a1c
3 files changed
+8
-10
No files matched your search
@@ -0,0 +1,2 @@
|
||||
ALTER TABLE `creature`
|
||||
CHANGE `npcflag` `npcflag` INT(10) UNSIGNED NULL;
|
||||
@@ -585,7 +585,7 @@ bool Creature::UpdateEntry(uint32 entry, CreatureData const* data /*= nullptr*/,
|
||||
|
||||
SetFaction(cInfo->faction);
|
||||
|
||||
uint32 npcflags, unitFlags, unitFlags2;
|
||||
uint32 npcflags = 0, unitFlags = 0, unitFlags2 = 0;
|
||||
ObjectMgr::ChooseCreatureFlags(cInfo, &npcflags, &unitFlags, &unitFlags2, _staticFlags, data);
|
||||
|
||||
if (cInfo->flags_extra & CREATURE_FLAG_EXTRA_WORLDEVENT)
|
||||
@@ -1989,10 +1989,10 @@ void Creature::setDeathState(DeathState s)
|
||||
if (!IsPet())
|
||||
{
|
||||
CreatureData const* creatureData = GetCreatureData();
|
||||
CreatureTemplate const* cinfo = GetCreatureTemplate();
|
||||
CreatureTemplate const* cInfo = GetCreatureTemplate();
|
||||
|
||||
uint32 npcflag, unitFlags, unitFlags2;
|
||||
ObjectMgr::ChooseCreatureFlags(cinfo, &npcflag, &unitFlags, &unitFlags2, _staticFlags, creatureData);
|
||||
uint32 npcflag = 0, unitFlags = 0, unitFlags2 = 0;
|
||||
ObjectMgr::ChooseCreatureFlags(cInfo, &npcflag, &unitFlags, &unitFlags2, _staticFlags, creatureData);
|
||||
|
||||
SetUInt32Value(UNIT_NPC_FLAGS, npcflag);
|
||||
SetUInt32Value(UNIT_FIELD_FLAGS, unitFlags);
|
||||
@@ -2001,7 +2001,7 @@ void Creature::setDeathState(DeathState s)
|
||||
|
||||
RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IN_COMBAT);
|
||||
|
||||
SetMeleeDamageSchool(SpellSchools(cinfo->dmgschool));
|
||||
SetMeleeDamageSchool(SpellSchools(cInfo->dmgschool));
|
||||
}
|
||||
|
||||
Motion_Initialize();
|
||||
|
||||
@@ -1601,8 +1601,6 @@ void ObjectMgr::ChooseCreatureFlags(CreatureTemplate const* cInfo, uint32* npcFl
|
||||
{
|
||||
#define ChooseCreatureFlagSource(field) ((data && data->field.has_value()) ? *data->field : cInfo->field)
|
||||
|
||||
if (data)
|
||||
{
|
||||
if (npcFlags)
|
||||
*npcFlags = ChooseCreatureFlagSource(npcflag);
|
||||
|
||||
@@ -1627,8 +1625,6 @@ void ObjectMgr::ChooseCreatureFlags(CreatureTemplate const* cInfo, uint32* npcFl
|
||||
if (staticFlags.HasFlag(CREATURE_STATIC_FLAG_4_PREVENT_SWIM))
|
||||
*unitFlags2 |= UNIT_FLAG2_AI_WILL_ONLY_SWIM_IF_TARGET_SWIMS;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
#undef ChooseCreatureFlagSource
|
||||
}
|
||||
@@ -2108,7 +2104,7 @@ void ObjectMgr::LoadCreatures()
|
||||
int16 gameEvent = fields[16].GetInt8();
|
||||
data.poolId = fields[17].GetUInt32();
|
||||
if (!fields[18].IsNull())
|
||||
data.npcflag = fields[18].GetUInt64();
|
||||
data.npcflag = fields[18].GetUInt32();
|
||||
if (!fields[19].IsNull())
|
||||
data.unit_flags = fields[19].GetUInt32();
|
||||
if (!fields[20].IsNull())
|
||||
|
||||
Reference in new issue
Block a user