Skip to content

Commit a9ac524

Browse files
committed
set ETS indexes despite power level
Fixes a crash of the player ship has a power level of 0.
1 parent 343bc17 commit a9ac524

1 file changed

Lines changed: 2 additions & 5 deletions

File tree

code/hud/hudets.cpp

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -398,15 +398,12 @@ void set_recharge_rates(object* obj, int shields, int weapons, int engines) {
398398

399399
// -------------------------------------------------------------------------------------------------
400400
// set_default_recharge_rates() will set the charge levels for the weapons, shields and
401-
// engines to their default levels
401+
// engines to their default levels (regardless of whether the ship has power or an ETS)
402402
void set_default_recharge_rates(object* obj)
403403
{
404404
ship* ship_p = &Ships[obj->instance];
405405
ship_info* ship_info_p = &Ship_info[ship_p->ship_info_index];
406406

407-
if ( ship_info_p->power_output == 0 )
408-
return;
409-
410407
int ship_properties = ets_properties(obj);
411408

412409
// the default charge rate depends on what systems are on each ship
@@ -440,7 +437,7 @@ void set_default_recharge_rates(object* obj)
440437
break;
441438

442439
default:
443-
Int3(); // if no systems, power output should be zero, and this funtion shouldn't be called
440+
set_recharge_rates(obj, ZERO_INDEX, ZERO_INDEX, ZERO_INDEX);
444441
break;
445442
} // end switch
446443
}

0 commit comments

Comments
 (0)