[7716] Fixed some typos and possible crashes.

This commit is contained in:
AlexDereka 2009-04-26 18:49:00 +04:00
parent c2e6dd20dd
commit c9d51a6dc7
25 changed files with 281 additions and 263 deletions

View file

@ -2103,12 +2103,12 @@ MeleeHitOutcome Unit::RollMeleeOutcomeAgainst (const Unit *pVictim, WeaponAttack
if(pVictim->GetTypeId()==TYPEID_PLAYER || !(((Creature*)pVictim)->GetCreatureInfo()->flags_extra & CREATURE_FLAG_EXTRA_NO_PARRY) )
{
int32 tmp = int32(parry_chance);
if ( (tmp > 0) // check if unit _can_ parry
&& ((tmp -= skillBonus) > 0)
&& (roll < (sum += tmp)))
int32 tmp2 = int32(parry_chance);
if ( (tmp2 > 0) // check if unit _can_ parry
&& ((tmp2 -= skillBonus) > 0)
&& (roll < (sum += tmp2)))
{
DEBUG_LOG ("RollMeleeOutcomeAgainst: PARRY <%d, %d)", sum-tmp, sum);
DEBUG_LOG ("RollMeleeOutcomeAgainst: PARRY <%d, %d)", sum-tmp2, sum);
return MELEE_HIT_PARRY;
}
}
@ -2989,7 +2989,7 @@ void Unit::SetCurrentCastedSpell( Spell * pSpell )
{
assert(pSpell); // NULL may be never passed here, use InterruptSpell or InterruptNonMeleeSpells
uint32 CSpellType = pSpell->GetCurrentContainer();
CurrentSpellTypes CSpellType = pSpell->GetCurrentContainer();
if (pSpell == m_currentSpells[CSpellType]) return; // avoid breaking self