1
This commit is contained in:
parent
a23e11bb66
commit
e41ddd96cb
@ -1159,6 +1159,20 @@ void Room::AirDrop(int appear_time, int box_id)
|
||||
Vector2D dir = Vector2D::UP;
|
||||
dir.Rotate(a8::RandAngle());
|
||||
Vector2D box_pos = gas_data.pos_new + dir * (500 + rand() % 300);
|
||||
#if 1
|
||||
if (box_pos.x < 1.0f) {
|
||||
box_pos.x = 1.0f;
|
||||
}
|
||||
if (box_pos.x >= MAP_WIDTH) {
|
||||
box_pos.x = MAP_WIDTH - 1;
|
||||
}
|
||||
if (box_pos.y < 1.0f) {
|
||||
box_pos.y = 1.0f;
|
||||
}
|
||||
if (box_pos.y >= MAP_HEIGHT) {
|
||||
box_pos.y = MAP_HEIGHT - 1;
|
||||
}
|
||||
#endif
|
||||
frame_event.AddAirDrop(appear_time, box_id, box_pos);
|
||||
xtimer.AddDeadLineTimerAndAttach(SERVER_FRAME_RATE * appear_time / 1000.f,
|
||||
a8::XParams()
|
||||
|
Loading…
x
Reference in New Issue
Block a user