Check some props before using

This commit is contained in:
Vortrex
2021-12-22 23:34:29 -06:00
parent 5fbe1265e4
commit 578e3675db
4 changed files with 109 additions and 41 deletions

View File

@@ -121,7 +121,10 @@ function sendResourceStoppedSignalToServer() {
function setPlayer2DRendering(hudState, labelState, smallGameMessageState, scoreboardState, hotBarState, itemActionDelayState) {
logToConsole(LOG_DEBUG, `[VRR.Main] Updating render states (HUD: ${hudState}, Labels: ${labelState}, Bottom Text: ${smallGameMessageState}, Scoreboard: ${scoreboardState}, HotBar: ${hotBarState}, Item Action Delay: ${itemActionDelayState})`);
renderHUD = hudState;
setHUDEnabled(hudState);
if(typeof setHUDEnabled != "undefined") {
setHUDEnabled(hudState);
}
renderLabels = labelState;
renderSmallGameMessage = smallGameMessageState;
@@ -272,7 +275,9 @@ function setLocalPlayerPedPartsAndProps(parts, props) {
// ===========================================================================
function setLocalPlayerArmour(armour) {
localPlayer.armour = armour;
if(typeof localPlayer.armour != "undefined") {
localPlayer.armour = armour;
}
}
// ===========================================================================