aboutsummaryrefslogtreecommitdiff
path: root/src/game/Creature.cpp
diff options
context:
space:
mode:
authorn0n4m3 <none@none>2009-12-19 19:10:14 +0100
committern0n4m3 <none@none>2009-12-19 19:10:14 +0100
commit12dd4b709ce318b7a0dd1b10200daf0c606f008c (patch)
tree6ae75000618c96aefa447daa430c9c7a5231de93 /src/game/Creature.cpp
parent73081c18c06581c2f8d874107b47addcd26d1fda (diff)
Set creatures PvP state flag based on creature faction and renamerelated enum. by NoFantasy
--HG-- branch : trunk
Diffstat (limited to 'src/game/Creature.cpp')
-rw-r--r--src/game/Creature.cpp15
1 files changed, 7 insertions, 8 deletions
diff --git a/src/game/Creature.cpp b/src/game/Creature.cpp
index c31906d110f..32a47334a9d 100644
--- a/src/game/Creature.cpp
+++ b/src/game/Creature.cpp
@@ -389,14 +389,13 @@ bool Creature::UpdateEntry(uint32 Entry, uint32 team, const CreatureData *data )
SetCanModifyStats(true);
UpdateAllStats();
- FactionTemplateEntry const* factionTemplate = sFactionTemplateStore.LookupEntry(GetCreatureInfo()->faction_A);
- if (factionTemplate) // check and error show at loading templates
+ // checked and error show at loading templates
+ if (FactionTemplateEntry const* factionTemplate = sFactionTemplateStore.LookupEntry(GetCreatureInfo()->faction_A))
{
- FactionEntry const* factionEntry = sFactionStore.LookupEntry(factionTemplate->faction);
- if (factionEntry)
- if( !(GetCreatureInfo()->flags_extra & CREATURE_FLAG_EXTRA_CIVILIAN) &&
- (factionEntry->team == ALLIANCE || factionEntry->team == HORDE) )
- SetPvP(true);
+ if (factionTemplate->factionFlags & FACTION_TEMPLATE_FLAG_PVP)
+ SetPvP(true);
+ else
+ SetPvP(false);
}
// HACK: trigger creature is always not selectable
@@ -2318,7 +2317,7 @@ bool Creature::LoadCreaturesAddon(bool reload)
// 3 ShapeshiftForm Must be determined/set by shapeshift spell/aura
SetByteValue(UNIT_FIELD_BYTES_2, 0, uint8(cainfo->bytes2 & 0xFF));
- SetByteValue(UNIT_FIELD_BYTES_2, 1, uint8((cainfo->bytes2 >> 8) & 0xFF));
+ //SetByteValue(UNIT_FIELD_BYTES_2, 1, uint8((cainfo->bytes2 >> 8) & 0xFF));
//SetByteValue(UNIT_FIELD_BYTES_2, 2, uint8((cainfo->bytes2 >> 16) & 0xFF));
SetByteValue(UNIT_FIELD_BYTES_2, 2, 0);
//SetByteValue(UNIT_FIELD_BYTES_2, 3, uint8((cainfo->bytes2 >> 24) & 0xFF));