From d0ff1c35d1af4a0ddd01fdd813f9b7e3f3d5fb77 Mon Sep 17 00:00:00 2001 From: Marisa Kirisame Date: Thu, 8 Aug 2019 12:02:48 +0200 Subject: [PATCH] Fix crash if HUD color is set to team in settings while player is not in a team. --- zscript/utmenu.zsc | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/zscript/utmenu.zsc b/zscript/utmenu.zsc index 9095e5c..80f35b6 100644 --- a/zscript/utmenu.zsc +++ b/zscript/utmenu.zsc @@ -31,7 +31,9 @@ Class OptionMenuItemUTHudPreview : OptionMenuItem switch ( mColorP.GetInt() ) { case 0: - tintcolor = Color(Teams[mPTeam.GetInt()].mName); + int t = Teams[mPTeam.GetInt(); + if ( t < Teams.Size() ) + tintcolor = Color(Teams[t].mName); break; case 1: tintcolor = Color(mPColor.GetString());