This commit is contained in:
aozhiwei 2021-03-11 17:42:00 +08:00
parent 627b32badf
commit f81d20b4b7

View File

@ -169,6 +169,16 @@ void Bullet::ProcBomb()
}
});
if (objects.empty()) {
float bullet_range = gun_meta->i->range();
if (gun_upgrade_meta && gun_upgrade_meta->GetAttrValue(gun_lv, kHAT_ShotRange) > 0) {
bullet_range += gun_upgrade_meta->GetAttrValue(gun_lv, kHAT_ShotRange);
}
float distance = (GetPos() - born_pos).Norm();
if (distance >= bullet_range) {
player->SummonObstacle(0, GetPos());
}
} else {
switch (meta->i->_inventory_slot()) {
case 4:
{
@ -196,6 +206,7 @@ void Bullet::ProcBomb()
}
break;
}
}
room->RemoveObjectLater(this);
}