Fix for crashing on skin select
This commit is contained in:
@@ -51,16 +51,24 @@ function processSkinSelectKeyPress(keyCode) {
|
|||||||
} else {
|
} else {
|
||||||
skinSelectorIndex++;
|
skinSelectorIndex++;
|
||||||
}
|
}
|
||||||
|
logToConsole(LOG_DEBUG, `Switching to skin ${allowedSkins[getGame()][skinSelectorIndex][1]} (Index: ${skinSelectorIndex}, Skin: ${allowedSkins[getGame()][skinSelectorIndex][0]})`);
|
||||||
skinSelectMessageTextTop = allowedSkins[getGame()][skinSelectorIndex][1];
|
skinSelectMessageTextTop = allowedSkins[getGame()][skinSelectorIndex][1];
|
||||||
localPlayer.skin = allowedSkins[getGame()][skinSelectorIndex][0];
|
localPlayer.skin = allowedSkins[getGame()][skinSelectorIndex][0];
|
||||||
|
localPlayer.position = skinSelectPosition;
|
||||||
|
localPlayer.heading = skinSelectHeading;
|
||||||
|
localPlayer.clearObjective();
|
||||||
} else if(keyCode == SDLK_LEFT || keyCode == SDLK_a) {
|
} else if(keyCode == SDLK_LEFT || keyCode == SDLK_a) {
|
||||||
if(skinSelectorIndex <= 0) {
|
if(skinSelectorIndex <= 0) {
|
||||||
skinSelectorIndex = allowedSkins[getGame()].length-1;
|
skinSelectorIndex = allowedSkins[getGame()].length-1;
|
||||||
} else {
|
} else {
|
||||||
skinSelectorIndex--;
|
skinSelectorIndex--;
|
||||||
}
|
}
|
||||||
|
logToConsole(LOG_DEBUG, `Switching to skin ${allowedSkins[getGame()][skinSelectorIndex][1]} (Index: ${skinSelectorIndex}, Skin: ${allowedSkins[getGame()][skinSelectorIndex][0]})`);
|
||||||
skinSelectMessageTextTop = allowedSkins[getGame()][skinSelectorIndex][1];
|
skinSelectMessageTextTop = allowedSkins[getGame()][skinSelectorIndex][1];
|
||||||
localPlayer.skin = allowedSkins[getGame()][skinSelectorIndex][0];
|
localPlayer.skin = allowedSkins[getGame()][skinSelectorIndex][0];
|
||||||
|
localPlayer.position = skinSelectPosition;
|
||||||
|
localPlayer.heading = skinSelectHeading;
|
||||||
|
localPlayer.clearObjective();
|
||||||
} else if(keyCode == SDLK_RETURN) {
|
} else if(keyCode == SDLK_RETURN) {
|
||||||
triggerNetworkEvent("vrr.skinSelected", skinSelectorIndex);
|
triggerNetworkEvent("vrr.skinSelected", skinSelectorIndex);
|
||||||
} else if(keyCode == SDLK_BACKSPACE) {
|
} else if(keyCode == SDLK_BACKSPACE) {
|
||||||
@@ -79,14 +87,11 @@ function processSkinSelectRendering() {
|
|||||||
skinSelectMessageFontBottom.render(skinSelectMessageTextBottom, [0, game.height-65], game.width, 0.5, 0.0, skinSelectMessageFontBottom.size, skinSelectMessageColourBottom, true, true, false, true);
|
skinSelectMessageFontBottom.render(skinSelectMessageTextBottom, [0, game.height-65], game.width, 0.5, 0.0, skinSelectMessageFontBottom.size, skinSelectMessageColourBottom, true, true, false, true);
|
||||||
//}
|
//}
|
||||||
}
|
}
|
||||||
|
//if(getMultiplayerMod() == VRR_MPMOD_GTAC) {
|
||||||
localPlayer.position = skinSelectPosition;
|
// if(gta.game == GAME_GTA_III || gta.game == GAME_GTA_VC) {
|
||||||
localPlayer.heading = skinSelectHeading;
|
// localPlayer.clearObjective();
|
||||||
if(getMultiplayerMod() == VRR_MPMOD_GTAC) {
|
// }
|
||||||
if(gta.game == GAME_GTA_III || gta.game == GAME_GTA_VC) {
|
//}
|
||||||
localPlayer.clearObjective();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user