Merge branch 'master' into test

This commit is contained in:
aozhiwei 2021-07-23 16:34:10 +08:00
commit ee1914129d
2 changed files with 16 additions and 5 deletions

View File

@ -429,12 +429,15 @@ void Bullet::Check(float distance)
}
bool need_remove = true;
if (distance < bullet_range) {
if (!gun_meta->i->is_penetrate_thing() && t_hit_num > 0 ||
!gun_meta->i->ispenetrate() && c_hit_num > 0) {
if (!gun_meta->i->is_penetrate_thing() && !gun_meta->i->ispenetrate()) {
} else {
if ((!gun_meta->i->is_penetrate_thing() && (t_hit_num > 0)) ||
(!gun_meta->i->ispenetrate() && (c_hit_num > 0))) {
} else {
need_remove = false;
}
}
}
if (need_remove) {
room->RemoveObjectLater(this);
later_removed_ = true;

View File

@ -3541,6 +3541,8 @@ void Human::OnBulletHit(Bullet* bullet)
return;
}
if (!dead && (bullet->IsBomb() || bullet->sender.Get()->team_id != team_id)) {
float old_hp = GetHP();
float old_max_hp = GetMaxHP();
float dmg = bullet->GetAtk();
float def = GetDef() * (1 + GetAbility()->GetAttrRate(kHAT_Def)) +
GetAbility()->GetAttrAbs(kHAT_Def);
@ -3565,10 +3567,16 @@ void Human::OnBulletHit(Bullet* bullet)
}
#ifdef DEBUG
bullet->sender.Get()->SendDebugMsg
(a8::Format("bullet weapon_id:%d atk:%f",
(a8::Format("bullet uniid:%d weapon_id:%d atk:%f def:%f finaly_dmg:%f old_hp:%f old_maxhp:%f cur_hp:%f",
{
bullet->GetUniId(),
bullet->gun_meta->i->id(),
bullet->GetAtk()
bullet->GetAtk(),
def,
finaly_dmg,
old_hp,
old_max_hp,
GetHP()
})
);
#endif