From 153b1b49625be56d0bac89a2161bed4472e9a5d0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B3zsef=20Sallai?= Date: Thu, 26 Jan 2023 16:56:13 +0200 Subject: [PATCH] fix P2 skin OOB error --- src/menu/coop_menu.rs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/menu/coop_menu.rs b/src/menu/coop_menu.rs index cbe9f2c..d67073e 100644 --- a/src/menu/coop_menu.rs +++ b/src/menu/coop_menu.rs @@ -153,10 +153,12 @@ impl PlayerCountMenu { if state.player2_skin_location.offset * 2 * 16 >= tex_size.1 { state.player2_skin_location.offset = 0; - if state.player2_skin_location.texture_index == 1 { + if (state.player2_skin_location.texture_index as usize) + == state.constants.player_skin_paths.len() - 1 + { state.player2_skin_location.texture_index = 0; } else { - state.player2_skin_location.texture_index = 1; + state.player2_skin_location.texture_index += 1; } } }