1
This commit is contained in:
parent
acdfbeb9ca
commit
5e0c045786
@ -907,15 +907,38 @@ void RoomObstacle::ActiveMedicalStation()
|
||||
}
|
||||
|
||||
void RoomObstacle::ActivePortal()
|
||||
{
|
||||
room->xtimer.AddRepeatTimerAndAttach
|
||||
(
|
||||
SERVER_FRAME_RATE,
|
||||
a8::XParams()
|
||||
.SetSender(this),
|
||||
[] (const a8::XParams& param)
|
||||
{
|
||||
RoomObstacle* obstacle = (RoomObstacle*)param.sender.GetUserData();
|
||||
obstacle->ProcPortal();
|
||||
},
|
||||
&xtimer_attacher.timer_list_
|
||||
);
|
||||
}
|
||||
|
||||
void RoomObstacle::ProcPortal()
|
||||
{
|
||||
if (room->IsGameOver()) {
|
||||
return;
|
||||
}
|
||||
if (room->IsPveRoom()) {
|
||||
return;
|
||||
}
|
||||
if (!grid_list_) {
|
||||
grid_list_ = new std::set<GridCell*>();
|
||||
room->grid_service->GetAllCellsByXy(room, GetPos().x, GetPos().y, *grid_list_);
|
||||
}
|
||||
bool ready = true;
|
||||
room->TraversePlayerList
|
||||
room->TraverseHumanList
|
||||
(
|
||||
a8::XParams(),
|
||||
[this, &ready] (Player* hum, a8::XParams& param)
|
||||
[this, &ready] (Human* hum, a8::XParams& param)
|
||||
{
|
||||
if (!a8::IntersectCircleCircle
|
||||
(
|
||||
@ -925,10 +948,15 @@ void RoomObstacle::ActivePortal()
|
||||
meta->i->height()
|
||||
)) {
|
||||
ready = false;
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
);
|
||||
if (ready) {
|
||||
room->GetIncubator()->NextWave();
|
||||
Die(room);
|
||||
BroadcastFullState(room);
|
||||
room->xtimer.DeleteTimer(room->xtimer.GetRunningTimer());
|
||||
}
|
||||
}
|
||||
|
@ -61,6 +61,7 @@ private:
|
||||
void ProcKeepRangeBuff();
|
||||
void DetachFromMaster();
|
||||
void InstallPreExplostionSummonTimer();
|
||||
void ProcPortal();
|
||||
|
||||
void CalcTempPassObjects();
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user