This commit is contained in:
aozhiwei 2021-09-09 16:17:41 +08:00
parent b915ae99bb
commit c7d68e326a
2 changed files with 15 additions and 1 deletions

View File

@ -384,7 +384,20 @@ void Car::BeKill(int killer_id, const std::string& killer_name, int weapon_id)
BroadcastDeleteState(room);
RemoveFromAroundPlayers(room);
room->grid_service->RemoveCreature(this);
if (hero_meta_->i->delay_remove() > 0) {
room->xtimer.AddDeadLineTimerAndAttach
(
hero_meta_->i->delay_remove() / FRAME_RATE_MS,
a8::XParams()
.SetSender(this),
[] (const a8::XParams& param)
{
},
&xtimer_attacher.timer_list_);
} else {
room->RemoveObjectLater(this);
}
int team_id = 0;
for (Human* passenger : passengers_) {
team_id = passenger->team_id;

View File

@ -217,6 +217,7 @@ message Player
optional int32 dead_drop = 29;
optional int32 delay_delete = 39;
optional int32 ai = 46;
optional int32 delay_remove = 47;
}
message Robot