This commit is contained in:
aozhiwei 2023-04-05 18:54:04 +08:00
parent b5eb72aade
commit 1929890541
2 changed files with 7 additions and 1 deletions

View File

@ -675,7 +675,7 @@ void Bullet::OnKillTarget(Entity* target)
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);
sender.Get()->AsHero()->master.Get()->AsHuman()->stats->kills++;
}
}
}

View File

@ -9,6 +9,7 @@
#include "roomobstacle.h"
#include "human.h"
#include "stats.h"
#include "hero.h"
#include "mt/Param.h"
#include "mt/Buff.h"
@ -179,6 +180,11 @@ void VirtualBullet::OnKillTarget(Entity* target)
if (c->IsHuman() && sender.Get() && sender.Get()->IsHuman()) {
sender.Get()->AsHuman()->stats->IncWeaponKills(gun_meta->id(), 1);
}
if (sender.Get()->IsHero() &&
sender.Get()->AsHero()->master.Get() &&
sender.Get()->AsHero()->master.Get()->IsHuman()) {
sender.Get()->AsHero()->master.Get()->AsHuman()->stats->kills++;
}
}
}