diff options
| author | megamage <none@none> | 2009-03-23 09:31:54 -0600 |
|---|---|---|
| committer | megamage <none@none> | 2009-03-23 09:31:54 -0600 |
| commit | 2c17957627f0cb308a8865e288cb8ec281d53465 (patch) | |
| tree | f1f4744c5c799c719f01f347f9eeb768c6b7daa8 /src | |
| parent | 8af4e2dd4252f278cab74f8ba05c10b3976da816 (diff) | |
*Fix a crash caused by RemoveSpellsCausingAuraWithDispel.
--HG--
branch : trunk
Diffstat (limited to 'src')
| -rw-r--r-- | src/game/Unit.cpp | 37 | ||||
| -rw-r--r-- | src/game/Unit.h | 5 |
2 files changed, 37 insertions, 5 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)) diff --git a/src/game/Unit.h b/src/game/Unit.h index 74e4028eedd..1f336b55138 100644 --- a/src/game/Unit.h +++ b/src/game/Unit.h @@ -418,8 +418,10 @@ enum UnitState UNIT_STAT_CASTING = 0x00008000, UNIT_STAT_POSSESSED = 0x00010000, UNIT_STAT_CHARGING = 0x00020000, + UNIT_STAT_JUMPING = 0x00040000, UNIT_STAT_MOVING = (UNIT_STAT_ROAMING | UNIT_STAT_CHASE), - UNIT_STAT_LOST_CONTROL = (UNIT_STAT_CONFUSED | UNIT_STAT_STUNNED | UNIT_STAT_FLEEING | UNIT_STAT_CHARGING), + UNIT_STAT_CONTROLLED = (UNIT_STAT_CONFUSED | UNIT_STAT_STUNNED | UNIT_STAT_FLEEING), + UNIT_STAT_LOST_CONTROL = (UNIT_STAT_CONTROLLED | UNIT_STAT_JUMPING | UNIT_STAT_CHARGING), UNIT_STAT_SIGHTLESS = (UNIT_STAT_LOST_CONTROL | UNIT_STAT_CHASE), UNIT_STAT_CANNOT_AUTOATTACK = (UNIT_STAT_LOST_CONTROL | UNIT_STAT_CASTING), UNIT_STAT_ALL_STATE = 0xffffffff //(UNIT_STAT_STOPPED | UNIT_STAT_MOVING | UNIT_STAT_IN_COMBAT | UNIT_STAT_IN_FLIGHT) @@ -1154,6 +1156,7 @@ class TRINITY_DLL_SPEC Unit : public WorldObject void SendMonsterStop(); void SendMonsterMove(float NewPosX, float NewPosY, float NewPosZ, uint32 Time, Player* player = NULL); + void SendMonsterMove(float NewPosX, float NewPosY, float NewPosZ, uint32 MoveFlags, uint32 time, float speedZ, Player *player = NULL); //void SendMonsterMove(float NewPosX, float NewPosY, float NewPosZ, uint8 type, uint32 MovementFlags, uint32 Time, Player* player = NULL); void SendMonsterMoveByPath(Path const& path, uint32 start, uint32 end); void SendMonsterMoveWithSpeed(float x, float y, float z, uint32 transitTime = 0, Player* player = NULL); |
