mirror of
https://github.com/HarbourMasters/Shipwright.git
synced 2024-11-25 10:52:19 -05:00
fix led crash when set to health (#3507)
This commit is contained in:
parent
269e9faa46
commit
f65b711376
@ -2100,10 +2100,10 @@ Color_RGB8 GetColorForControllerLED() {
|
|||||||
if (source == LED_SOURCE_CUSTOM) {
|
if (source == LED_SOURCE_CUSTOM) {
|
||||||
color = CVarGetColor24("gLedPort1Color", { 255, 255, 255 });
|
color = CVarGetColor24("gLedPort1Color", { 255, 255, 255 });
|
||||||
}
|
}
|
||||||
if (criticalOverride || source == LED_SOURCE_HEALTH) {
|
if (gPlayState && (criticalOverride || source == LED_SOURCE_HEALTH)) {
|
||||||
if (HealthMeter_IsCritical()) {
|
if (HealthMeter_IsCritical()) {
|
||||||
color = { 0xFF, 0, 0 };
|
color = { 0xFF, 0, 0 };
|
||||||
} else if (source == LED_SOURCE_HEALTH) {
|
} else if (gSaveContext.healthCapacity != 0 && source == LED_SOURCE_HEALTH) {
|
||||||
if (gSaveContext.health / gSaveContext.healthCapacity <= 0.4f) {
|
if (gSaveContext.health / gSaveContext.healthCapacity <= 0.4f) {
|
||||||
color = { 0xFF, 0xFF, 0 };
|
color = { 0xFF, 0xFF, 0 };
|
||||||
} else {
|
} else {
|
||||||
|
Loading…
Reference in New Issue
Block a user