This commit is contained in:
aozhiwei 2023-04-04 21:27:44 +08:00
parent 492862be1a
commit 9828aeb470

View File

@ -28,6 +28,7 @@
#include "debugcmd.h"
#include "stats.h"
#include "movement.h"
#include "hero.h"
#include "mt/Param.h"
#include "mt/Equip.h"
@ -669,6 +670,12 @@ void Bullet::OnKillTarget(Entity* target)
Creature* c = (Creature*)target;
if (c->IsHuman() && sender.Get() && sender.Get()->IsHuman()) {
sender.Get()->AsHuman()->stats->IncWeaponKills(gun_meta->id(), 1);
sender.Get()->GetTrigger()->BulletKill(this, c);
}
if (sender.Get()->IsHero() &&
sender.Get()->AsHero()->master.Get() &&
sender.Get()->AsHero()->master.Get()->IsHuman()) {
sender.Get()->AsHero()->master.Get()->AsHuman()->stats->IncWeaponKills(gun_meta->id(), 1);
}
}
}