[10797] Check for valid sheath state in creature addon at startup.

Signed-off-by: NoFantasy <nofantasy@nf.no>
This commit is contained in:
NoFantasy 2010-11-30 09:41:59 +01:00
parent a2909f2674
commit afe50cd549
4 changed files with 7 additions and 4 deletions

View file

@ -1857,8 +1857,8 @@ bool Creature::LoadCreatureAddon(bool reload)
// 1 UnitPVPStateFlags Set at Creature::UpdateEntry (SetPvp()) // 1 UnitPVPStateFlags Set at Creature::UpdateEntry (SetPvp())
// 2 UnitRename Pet only, so always 0 for default creature // 2 UnitRename Pet only, so always 0 for default creature
// 3 ShapeshiftForm Must be determined/set by shapeshift spell/aura // 3 ShapeshiftForm Must be determined/set by shapeshift spell/aura
if (cainfo->stash != 0) if (cainfo->sheath_state != 0)
SetByteValue(UNIT_FIELD_BYTES_2, 0, cainfo->stash); SetByteValue(UNIT_FIELD_BYTES_2, 0, cainfo->sheath_state);
if (cainfo->pvp_state != 0) if (cainfo->pvp_state != 0)
SetByteValue(UNIT_FIELD_BYTES_2, 1, cainfo->pvp_state); SetByteValue(UNIT_FIELD_BYTES_2, 1, cainfo->pvp_state);

View file

@ -203,7 +203,7 @@ struct CreatureDataAddon
uint32 guidOrEntry; uint32 guidOrEntry;
uint32 mount; uint32 mount;
uint32 bytes1; uint32 bytes1;
uint8 stash; // SheathState uint8 sheath_state; // SheathState
uint8 pvp_state; // UnitPVPStateFlags uint8 pvp_state; // UnitPVPStateFlags
uint32 emote; uint32 emote;
uint32 splineFlags; uint32 splineFlags;

View file

@ -853,6 +853,9 @@ void ObjectMgr::LoadCreatureAddons(SQLStorage& creatureaddons, char const* entry
} }
} }
if (addon->sheath_state > SHEATH_STATE_RANGED)
sLog.outErrorDb("Creature (%s %u) has unknown sheath state (%u) defined in `%s`.", entryName, addon->guidOrEntry, addon->sheath_state, creatureaddons.GetTableName());
if (!sEmotesStore.LookupEntry(addon->emote)) if (!sEmotesStore.LookupEntry(addon->emote))
{ {
sLog.outErrorDb("Creature (%s %u) have invalid emote (%u) defined in `%s`.", entryName, addon->guidOrEntry, addon->emote, creatureaddons.GetTableName()); sLog.outErrorDb("Creature (%s %u) have invalid emote (%u) defined in `%s`.", entryName, addon->guidOrEntry, addon->emote, creatureaddons.GetTableName());

View file

@ -1,4 +1,4 @@
#ifndef __REVISION_NR_H__ #ifndef __REVISION_NR_H__
#define __REVISION_NR_H__ #define __REVISION_NR_H__
#define REVISION_NR "10796" #define REVISION_NR "10797"
#endif // __REVISION_NR_H__ #endif // __REVISION_NR_H__