修复坦克半径问题

This commit is contained in:
aozhiwei 2019-09-04 11:57:36 +08:00
parent 83a972ba4f
commit 84e64c76e0
2 changed files with 4 additions and 0 deletions

View File

@ -1998,6 +1998,8 @@ int Human::SkinLv()
void Human::CheckSkinTank() void Human::CheckSkinTank()
{ {
if (tank_weapon.meta) { if (tank_weapon.meta) {
float old_rad = self_collider_->rad;
self_collider_->rad = tank_weapon.meta->i->rad2();
std::set<Human*> objects; std::set<Human*> objects;
for (auto& grid : grid_list) { for (auto& grid : grid_list) {
for (Human* hum: grid->human_list) { for (Human* hum: grid->human_list) {
@ -2012,6 +2014,7 @@ void Human::CheckSkinTank()
for (Human* hum : objects) { for (Human* hum : objects) {
hum->BeKill(entity_uniid, name, VW_Tank); hum->BeKill(entity_uniid, name, VW_Tank);
} }
self_collider_->rad = old_rad;
} }
} }

View File

@ -78,6 +78,7 @@ message Equip
optional float bullet_angle = 34; // optional float bullet_angle = 34; //
optional string name = 35; // optional string name = 35; //
optional float rad = 36; // optional float rad = 36; //
optional float rad2 = 37;
optional string inventory_slot = 31; // optional string inventory_slot = 31; //
optional int32 _inventory_slot = 32; // optional int32 _inventory_slot = 32; //