diff --git a/server/gameserver/roomobstacle.cc b/server/gameserver/roomobstacle.cc index e29fef13..b1d5bd84 100644 --- a/server/gameserver/roomobstacle.cc +++ b/server/gameserver/roomobstacle.cc @@ -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(); + 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_ + ); + } +} diff --git a/server/gameserver/roomobstacle.h b/server/gameserver/roomobstacle.h index 9b2d11a1..ac37e0e7 100644 --- a/server/gameserver/roomobstacle.h +++ b/server/gameserver/roomobstacle.h @@ -53,6 +53,7 @@ private: void ActiveGully(); void ActiveAirDrop(); void ActiveKeepRangeBuff(); + void ActiveMedicalStation(); void SummonAirDropBox(int box_id); void ProcKeepRangeBuff();