1
This commit is contained in:
parent
35179492c7
commit
b2bf05246e
@ -464,8 +464,8 @@ void Room::UpdateGas()
|
|||||||
(gas_data.pos_old - gas_data.pos_new).Norm();
|
(gas_data.pos_old - gas_data.pos_new).Norm();
|
||||||
float distance = gas_data.old_area_meta->i->shrink_speed() *
|
float distance = gas_data.old_area_meta->i->shrink_speed() *
|
||||||
((frame_no - gas_data.gas_start_frameno) * (1.0 / SERVER_FRAME_RATE));
|
((frame_no - gas_data.gas_start_frameno) * (1.0 / SERVER_FRAME_RATE));
|
||||||
gas_data.gas_progress = std::min(distance, total_distance);
|
gas_data.gas_progress = std::min(total_distance - distance, 0.0f);
|
||||||
if (std::abs(total_distance-distance) >= 0.001f) {
|
if (distance >= total_distance) {
|
||||||
int pre_area_id = gas_data.new_area_meta->i->id();
|
int pre_area_id = gas_data.new_area_meta->i->id();
|
||||||
Vector2D pre_pos = gas_data.pos_new;
|
Vector2D pre_pos = gas_data.pos_new;
|
||||||
if (!MetaMgr::Instance()->GetSafeArea(pre_area_id + 1)) {
|
if (!MetaMgr::Instance()->GetSafeArea(pre_area_id + 1)) {
|
||||||
@ -503,6 +503,9 @@ bool Room::GenSmallCircle(Vector2D big_circle_pos, float big_circle_rad, float s
|
|||||||
Vector2D dir = Vector2D::UP;
|
Vector2D dir = Vector2D::UP;
|
||||||
dir.Rotate(a8::RandAngle());
|
dir.Rotate(a8::RandAngle());
|
||||||
float rad = rand() % (int)(big_circle_rad - small_circle_rad);
|
float rad = rand() % (int)(big_circle_rad - small_circle_rad);
|
||||||
|
if (rad <= 0.001f){
|
||||||
|
rad = 0.001f;
|
||||||
|
}
|
||||||
out_pos = big_circle_pos + dir * rad;
|
out_pos = big_circle_pos + dir * rad;
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user