Skip to content

Commit 2a998f1

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 2a998f1

1 file changed

Lines changed: 2 additions & 8 deletions

File tree

code/hud/hudets.cpp

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -398,15 +398,9 @@ 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
{
404-
ship* ship_p = &Ships[obj->instance];
405-
ship_info* ship_info_p = &Ship_info[ship_p->ship_info_index];
406-
407-
if ( ship_info_p->power_output == 0 )
408-
return;
409-
410404
int ship_properties = ets_properties(obj);
411405

412406
// the default charge rate depends on what systems are on each ship
@@ -440,7 +434,7 @@ void set_default_recharge_rates(object* obj)
440434
break;
441435

442436
default:
443-
Int3(); // if no systems, power output should be zero, and this funtion shouldn't be called
437+
set_recharge_rates(obj, ZERO_INDEX, ZERO_INDEX, ZERO_INDEX);
444438
break;
445439
} // end switch
446440
}

0 commit comments

Comments
 (0)