mangosArchives / Mangos-One-server-old

This repo has been moved to https://githubs.com/mangosone/server
http://getmangos.eu/
GNU General Public License v2.0
95 stars 54 forks source link

[bug] Sometimes players are able to cast spell at already dead units. #12

Closed Visagalis closed 11 years ago

Visagalis commented 12 years ago

Sometimes players are able to cast spell at already dead units, right after kill sometimes you start castng another spell.

fixed problem with casting spell at already dead target.

diff --git a/src/game/Unit.cpp b/src/game/Unit.cpp
index da04012..9e256e4 100644
--- a/src/game/Unit.cpp
+++ b/src/game/Unit.cpp
@@ -812,6 +812,7 @@ uint32 Unit::DealDamage(Unit *pVictim, uint32 damage, CleanDamage const* cleanDa
                 if (BattleGround *bg = player_tap->GetBattleGround())
                     bg->HandleKillUnit((Creature*)pVictim, player_tap);
         }
+        CombatStop(true);
     }
     else                                                    // if (health <= damage)
     {
DomGries commented 12 years ago

Thanks. Any idea why its not a problem on master?

Visagalis commented 12 years ago

i don't know. I haven't checked on master.

DomGries commented 12 years ago

No need to close it :P

Visagalis commented 12 years ago

oh my bad, i accidentaly clicked comment and close :D

Visagalis commented 12 years ago

my patch has bug, seems like only players need to combatstop(true);

otherwise npcs doesn't reset when they kill player.