From 1becd0d68a86f2091a345e5203ccb31b4f1d128f Mon Sep 17 00:00:00 2001 From: Allanis Date: Sun, 17 Nov 2013 14:28:03 +0000 Subject: [PATCH] [Change] When creating a new pilot with pilot.add(), pretend to enter from hyperspace if we have a large distance from planet. --- src/llua_pilot.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/llua_pilot.c b/src/llua_pilot.c index 269e98f..8fdee1f 100644 --- a/src/llua_pilot.c +++ b/src/llua_pilot.c @@ -237,8 +237,13 @@ static int pilot_addFleet(lua_State* L) { RNG(75, 150) * (RNG(0,1) ? 1 : -1)); /* Set velocity only if no position is set.. */ - if(lv != NULL) - vectnull(&vv); + if(lv != NULL) { + if(VMOD(lv->vec) > MIN_HYPERSPACE_DIST) { + a = vect_angle(&vp, &vn); + vect_pset(&vv, plt->ship->speed * 3., a); + } + else vectnull(&vv); + } else { /* Enterting via hyperspace. */ a = vect_angle(&vp, &vn); vect_pset(&vv, plt->ship->speed * 3., a);