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,24 +19,27 @@ function processSync(event, deltaTime) {
//} //}
} }
if (localPlayer.health <= 0) {
if (!calledDeathEvent) { if (calledDeathEvent == false) {
logToConsole(LOG_DEBUG, `Local player died`); if (localPlayer.health <= 0) {
localPlayer.clearWeapons(); if (!calledDeathEvent) {
calledDeathEvent = true; logToConsole(LOG_DEBUG, `Local player died`);
sendNetworkEventToServer("v.rp.playerDeath"); localPlayer.clearWeapons();
calledDeathEvent = true;
sendNetworkEventToServer("v.rp.playerDeath");
}
} }
} }
} }
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);