Merge branch 'master' of github.com:it0uchpods/IDG-A32X

This commit is contained in:
Joshua Davidson 2018-11-07 17:19:12 -05:00
commit 92cc62fcfc
2 changed files with 7 additions and 2 deletions

View file

@ -42,6 +42,7 @@ var _loop = func() {
var time = getprop("/sim/time/elapsed-sec"); var time = getprop("/sim/time/elapsed-sec");
var prop = math.min(math.max(_K_p * deltaV, -_F_p), _F_p); var prop = math.min(math.max(_K_p * deltaV, -_F_p), _F_p);
var speedup = getprop("/sim/speed-up"); var speedup = getprop("/sim/speed-up");
var deriv = 0;
dt = time - _time; dt = time - _time;
# XXX Sanitising dt. Smaller chance of freakout on lag spike. # XXX Sanitising dt. Smaller chance of freakout on lag spike.
if(dt > 0.0) { if(dt > 0.0) {

View file

@ -26,9 +26,13 @@ var _D_min = nil;
var _add = func(pos) { var _add = func(pos) {
if (_N) { if (_N) {
var (A, S) = courseAndDistance(_user_points.arr[_N - 1], pos); var (A, S) = courseAndDistance(_user_points.arr[_N - 1], pos);
if (S * NM2M < 3 * _D_min) { S *= NM2M;
if (S < 3 * _D_min) {
gui.popupTip("Too close to the previous point,\ntry again"); gui.popupTip("Too close to the previous point,\ntry again");
return; return;
}else if (S > 10000.0) {
gui.popupTip("Too far from the previous point,\ntry again");
return;
} }
} }
_user_points.add(geo.Coord.new(pos)); _user_points.add(geo.Coord.new(pos));