aboutsummaryrefslogtreecommitdiff
path: root/src/game/Unit.cpp
diff options
context:
space:
mode:
authormegamage <none@none>2009-03-23 09:31:54 -0600
committermegamage <none@none>2009-03-23 09:31:54 -0600
commit2c17957627f0cb308a8865e288cb8ec281d53465 (patch)
treef1f4744c5c799c719f01f347f9eeb768c6b7daa8 /src/game/Unit.cpp
parent8af4e2dd4252f278cab74f8ba05c10b3976da816 (diff)
*Fix a crash caused by RemoveSpellsCausingAuraWithDispel.
--HG-- branch : trunk
Diffstat (limited to 'src/game/Unit.cpp')
-rw-r--r--src/game/Unit.cpp37
1 files changed, 33 insertions, 4 deletions
diff --git a/src/game/Unit.cpp b/src/game/Unit.cpp
index 4fdb5b06d94..4d79049cb5e 100644
--- a/src/game/Unit.cpp
+++ b/src/game/Unit.cpp
@@ -320,7 +320,7 @@ void Unit::SendMonsterStop()
void Unit::SendMonsterMove(float NewPosX, float NewPosY, float NewPosZ, uint32 Time, Player* player)
{
- WorldPacket data( SMSG_MONSTER_MOVE, (41 + GetPackGUID().size()) );
+ WorldPacket data( SMSG_MONSTER_MOVE, 12+4+1+4+4+4+12+GetPackGUID().size());
data.append(GetPackGUID());
data << GetPositionX() << GetPositionY() << GetPositionZ();
@@ -339,6 +339,35 @@ void Unit::SendMonsterMove(float NewPosX, float NewPosY, float NewPosZ, uint32 T
SendMessageToSet( &data, true );
}
+void Unit::SendMonsterMove(float NewPosX, float NewPosY, float NewPosZ, uint32 MoveFlags, uint32 time, float speedZ, Player *player)
+{
+ WorldPacket data( SMSG_MONSTER_MOVE, 12+4+1+4+4+4+12+GetPackGUID().size());
+ data.append(GetPackGUID());
+
+ data << GetPositionX() << GetPositionY() << GetPositionZ();
+ data << getMSTime();
+
+ data << uint8(0);
+ data << MoveFlags;
+
+ if(MoveFlags & MOVEFLAG_JUMP)
+ {
+ data << time;
+ data << speedZ;
+ data << (uint32)0; // walk time after jump
+ }
+ else
+ data << time;
+
+ data << uint32(1); // 1 single waypoint
+ data << NewPosX << NewPosY << NewPosZ; // the single waypoint Point B
+
+ if(player)
+ player->GetSession()->SendPacket(&data);
+ else
+ SendMessageToSet( &data, true );
+}
+
/*void Unit::SendMonsterMove(float NewPosX, float NewPosY, float NewPosZ, uint8 type, uint32 MovementFlags, uint32 Time, Player* player)
{
WorldPacket data( SMSG_MONSTER_MOVE, (41 + GetPackGUID().size()) );
@@ -507,8 +536,8 @@ void Unit::RemoveSpellsCausingAuraWithDispel(AuraType auraType, Spell * spell)
if (auraType >= TOTAL_AURAS) return;
DispelEntry entry;
DispelSet dispel_list;
- AuraList::iterator iter, next;
- for (iter = m_modAuras[auraType].begin(); iter != m_modAuras[auraType].end(); iter = next)
+ AuraList::iterator iter;
+ for (iter = m_modAuras[auraType].begin(); iter != m_modAuras[auraType].end(); ++iter)
{
entry.casterGuid = (*iter)->GetCasterGUID();
entry.spellId = (*iter)->GetId();
@@ -516,7 +545,7 @@ void Unit::RemoveSpellsCausingAuraWithDispel(AuraType auraType, Spell * spell)
dispel_list.insert (entry);
}
- for(DispelSet::iterator itr = dispel_list.begin(); itr != dispel_list.end();++itr)
+ for(DispelSet::iterator itr = dispel_list.begin(); itr != dispel_list.end(); ++itr)
{
entry = *itr;
if (GetDispelChance(spell, entry.caster, entry.spellId))