aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/game/Creature.cpp6
-rw-r--r--src/game/NullCreatureAI.cpp5
-rw-r--r--src/game/NullCreatureAI.h1
-rw-r--r--src/game/Player.cpp5
-rw-r--r--src/game/Unit.cpp2
5 files changed, 14 insertions, 5 deletions
diff --git a/src/game/Creature.cpp b/src/game/Creature.cpp
index d31e6dec1a1..c075a33e92f 100644
--- a/src/game/Creature.cpp
+++ b/src/game/Creature.cpp
@@ -290,6 +290,9 @@ bool Creature::InitEntry(uint32 Entry, uint32 team, const CreatureData *data )
if(!m_respawnradius && m_defaultMovementType==RANDOM_MOTION_TYPE)
m_defaultMovementType = IDLE_MOTION_TYPE;
+ for(int i=0; i < CREATURE_MAX_SPELLS; ++i)
+ m_spells[i] = GetCreatureInfo()->spells[i];
+
return true;
}
@@ -345,9 +348,6 @@ bool Creature::UpdateEntry(uint32 Entry, uint32 team, const CreatureData *data )
SetPvP(true);
}
- for(int i=0; i < CREATURE_MAX_SPELLS; ++i)
- m_spells[i] = GetCreatureInfo()->spells[i];
-
// HACK: trigger creature is always not selectable
if(isTrigger())
SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
diff --git a/src/game/NullCreatureAI.cpp b/src/game/NullCreatureAI.cpp
index 2745dd3ea8d..be59ed6e40d 100644
--- a/src/game/NullCreatureAI.cpp
+++ b/src/game/NullCreatureAI.cpp
@@ -27,6 +27,11 @@ void PassiveAI::UpdateAI(const uint32)
EnterEvadeMode();
}
+void PossessedAI::AttackStart(Unit *target)
+{
+ me->Attack(target, true);
+}
+
void PossessedAI::UpdateAI(const uint32 diff)
{
if(me->getVictim())
diff --git a/src/game/NullCreatureAI.h b/src/game/NullCreatureAI.h
index f628a7e8ac9..626dd307ef3 100644
--- a/src/game/NullCreatureAI.h
+++ b/src/game/NullCreatureAI.h
@@ -41,6 +41,7 @@ class TRINITY_DLL_DECL PossessedAI : public PassiveAI
public:
PossessedAI(Creature *c) : PassiveAI(c) {}
+ void AttackStart(Unit *target);
void UpdateAI(const uint32);
void EnterEvadeMode() {}
diff --git a/src/game/Player.cpp b/src/game/Player.cpp
index 68bb5628887..61968fae0c4 100644
--- a/src/game/Player.cpp
+++ b/src/game/Player.cpp
@@ -20308,7 +20308,10 @@ void Player::EnterVehicle(Vehicle *vehicle)
data << uint32(0x00000000);
data << uint32(0x00000101);
- for(uint32 i = 0; i < 10; ++i)
+ for(uint32 i = 0; i < CREATURE_MAX_SPELLS; ++i)
+ data << uint16(vehicle->m_spells[i]) << uint8(0) << uint8(i+8);
+
+ for(uint32 i = CREATURE_MAX_SPELLS; i < 10; ++i)
data << uint16(0) << uint8(0) << uint8(i+8);
data << uint8(0);
diff --git a/src/game/Unit.cpp b/src/game/Unit.cpp
index 118636edcc0..bf750be34f5 100644
--- a/src/game/Unit.cpp
+++ b/src/game/Unit.cpp
@@ -483,7 +483,7 @@ void Unit::RemoveAuraTypeByCaster(AuraType auraType, uint64 casterGUID)
{
if (auraType >= TOTAL_AURAS) return;
AuraList::iterator iter, next;
- for(iter = m_modAuras[auraType].begin(); iter != m_modAuras[auraType].end(); ++iter)
+ for(iter = m_modAuras[auraType].begin(); iter != m_modAuras[auraType].end(); iter = next)
{
next = iter;
++next;