Corrected some logic in my recent commits.

- ff2dbfc381 thanks LihO
- 6ccf95af4c thanks frostmourne
This commit is contained in:
kaelima
2011-12-22 18:48:06 +01:00
parent ce0dfa88a6
commit 398299084e
2 changed files with 11 additions and 8 deletions

View File

@@ -3483,7 +3483,7 @@ void Spell::update(uint32 difftime)
{
case SPELL_STATE_PREPARING:
{
if (m_timer)
if (m_timer > 0)
{
if (difftime >= (uint32)m_timer)
m_timer = 0;
@@ -3498,7 +3498,7 @@ void Spell::update(uint32 difftime)
}
case SPELL_STATE_CASTING:
{
if (m_timer > 0)
if (m_timer)
{
// check if there are alive targets left
if (!UpdateChanneledTargetList())
@@ -3508,10 +3508,13 @@ void Spell::update(uint32 difftime)
finish();
}
if (difftime >= (uint32)m_timer)
m_timer = 0;
else
m_timer -= difftime;
if (m_timer > 0)
{
if (difftime >= (uint32)m_timer)
m_timer = 0;
else
m_timer -= difftime;
}
}
if (m_timer == 0)

View File

@@ -840,7 +840,7 @@ public:
{
DoCast(target, SPELL_MULTI_SHOT);
}
else if (target)
else
{
Map::PlayerList const& players = me->GetMap()->GetPlayers();
if (me->GetMap()->IsDungeon() && !players.isEmpty())
@@ -850,7 +850,7 @@ public:
Player* player = itr->getSource();
if (player && !player->isGameMaster() && me->IsInRange(player, 5.0f, 30.0f, false))
{
DoCast(target, SPELL_MULTI_SHOT);
DoCast(player, SPELL_MULTI_SHOT);
break;
}
}