Get rid of old death handling

This commit is contained in:
Vortrex
2023-02-15 03:17:37 -06:00
parent fd703e969a
commit f755de8de6

View File

@@ -19,6 +19,8 @@ function processSync(event, deltaTime) {
//} //}
} }
if (calledDeathEvent == false) {
if (localPlayer.health <= 0) { if (localPlayer.health <= 0) {
if (!calledDeathEvent) { if (!calledDeathEvent) {
logToConsole(LOG_DEBUG, `Local player died`); logToConsole(LOG_DEBUG, `Local player died`);
@@ -28,15 +30,16 @@ function processSync(event, deltaTime) {
} }
} }
} }
}
if (localPlayer.health <= 0) { //if (localPlayer.health <= 0) {
if (!calledDeathEvent) { // if (!calledDeathEvent) {
logToConsole(LOG_DEBUG, `Local player died`); // logToConsole(LOG_DEBUG, `Local player died`);
localPlayer.clearWeapons(); // localPlayer.clearWeapons();
calledDeathEvent = true; // calledDeathEvent = true;
sendNetworkEventToServer("v.rp.playerDeath"); // sendNetworkEventToServer("v.rp.playerDeath");
} // }
} //}
if (streamingRadioElement) { if (streamingRadioElement) {
//streamingRadio.volume = getStreamingRadioVolumeForPosition(streamingRadio.position); //streamingRadio.volume = getStreamingRadioVolumeForPosition(streamingRadio.position);