This commit is contained in:
aozhiwei 2022-08-01 19:17:35 +08:00
parent eaa80bf3fb
commit 713a893fc6
2 changed files with 25 additions and 1 deletions

View File

@ -317,7 +317,7 @@ void RoomObstacle::Active()
break;
case kObstacleMedicalStation:
{
ActiveMedicalStation();
}
break;
default:
@ -828,3 +828,26 @@ void RoomObstacle::CalcTempPassObjects()
);
}
}
void RoomObstacle::ActiveMedicalStation()
{
if (!grid_list_) {
grid_list_ = new std::set<GridCell*>();
room->grid_service->GetAllCellsByXy(room, GetPos().x, GetPos().y, *grid_list_);
}
if (meta->i->width() > 0 && meta->int_param1 > 0) {
room->xtimer.AddDeadLineTimerAndAttach
(
meta->int_param1 / FRAME_RATE_MS,
a8::XParams()
.SetSender(this),
[] (const a8::XParams& param)
{
RoomObstacle* obstacle = (RoomObstacle*)param.sender.GetUserData();
Room* room = obstacle->room;
},
&xtimer_attacher.timer_list_
);
}
}

View File

@ -53,6 +53,7 @@ private:
void ActiveGully();
void ActiveAirDrop();
void ActiveKeepRangeBuff();
void ActiveMedicalStation();
void SummonAirDropBox(int box_id);
void ProcKeepRangeBuff();