Skip to content

Commit 7502cf3

Browse files
authored
Stationary jump types should not try to avoid collision (#6738)
* no sweeper jump collision avoidance * few adjustments * only use short range distance check
1 parent 787c19e commit 7502cf3

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

code/ai/aicode.cpp

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14442,6 +14442,8 @@ void ai_warp_out(object *objp)
1444214442
// Goober5000 - make sure the flag is clear (if it was previously set)
1444314443
aip->ai_flags.remove(AI::AI_Flags::Trying_unsuccessfully_to_warp);
1444414444

14445+
WarpParams* warp_params = &Warp_params[shipp->warpout_params_index];
14446+
1444514447
switch (aip->submode) {
1444614448
case AIS_WARP_1:
1444714449
aip->force_warp_time = timestamp(10*1000); // Try to avoid a collision for up to ten seconds.
@@ -14450,9 +14452,9 @@ void ai_warp_out(object *objp)
1445014452
break;
1445114453
case AIS_WARP_2: // Make sure won't collide with any object.
1445214454
if (timestamp_elapsed(aip->force_warp_time)
14453-
|| (!collide_predict_large_ship(objp, objp->radius*2.0f + 100.0f)
14454-
|| (Warp_params[shipp->warpout_params_index].warp_type == WT_HYPERSPACE
14455-
&& !collide_predict_large_ship(objp, 100000.0f)))) {
14455+
|| (warp_params->warp_type == WT_SWEEPER)
14456+
|| (warp_params->warp_type == WT_IN_PLACE_ANIM)
14457+
|| (!collide_predict_large_ship(objp, objp->radius * 2.0f + 100.0f))) {
1445614458
aip->submode = AIS_WARP_3;
1445714459
aip->submode_start_time = Missiontime;
1445814460

@@ -14494,7 +14496,7 @@ void ai_warp_out(object *objp)
1449414496
break;
1449514497
case AIS_WARP_4: {
1449614498
// Only lets the ship warp after waiting for the warpout engage time
14497-
if ( (Missiontime / 100) >= (aip->submode_start_time / 100 + Warp_params[shipp->warpout_params_index].warpout_engage_time) ) {
14499+
if ( (Missiontime / 100) >= (aip->submode_start_time / 100 + warp_params->warpout_engage_time) ) {
1449814500
shipfx_warpout_start(objp);
1449914501
aip->submode = AIS_WARP_5;
1450014502
aip->submode_start_time = Missiontime;

0 commit comments

Comments
 (0)