From 3e31fd36acd2e4fed2353620de516b5922482c55 Mon Sep 17 00:00:00 2001 From: Marisa Kirisame Date: Sat, 13 Jun 2020 23:51:30 +0200 Subject: [PATCH] Fix Wallbuster shuffling code. --- language.version | 2 +- zscript/swwm_cbt.zsc | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/language.version b/language.version index bcd3c635d..04dd3f6a4 100644 --- a/language.version +++ b/language.version @@ -1,2 +1,2 @@ [default] -SWWM_MODVER="\cxSWWM GZ\c- r344 (Sat 13 Jun 23:35:07 CEST 2020)"; +SWWM_MODVER="\cxSWWM GZ\c- r345 (Sat 13 Jun 23:51:31 CEST 2020)"; diff --git a/zscript/swwm_cbt.zsc b/zscript/swwm_cbt.zsc index 338d232b8..cb4ec0c65 100644 --- a/zscript/swwm_cbt.zsc +++ b/zscript/swwm_cbt.zsc @@ -111,7 +111,8 @@ Class WallbusterReloadMenu : GenericMenu continue; candidates.Push(i); } - sel0 = Random[WallbusterMenu](0,candidates.Size()-1); + if ( candidates.Size() <= 0 ) return; + sel0 = candidates[Random[WallbusterMenu](0,candidates.Size()-1)]; CVar.GetCVar('swwm_cbtlast',players[consoleplayer]).SetInt(sel0); AmmoSets[sel0]++; queue.Push(sel0);