From 1c214f1954dc17f9846ad22e47a3e57ad005c8d4 Mon Sep 17 00:00:00 2001 From: UndeadZeratul Date: Sat, 24 Jun 2023 12:31:40 -0500 Subject: [PATCH] Fix Debug Statements throwing errors --- zscript/universalreloader/items/universalReloader.zsc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/zscript/universalreloader/items/universalReloader.zsc b/zscript/universalreloader/items/universalReloader.zsc index f9ee1c0..4e3b5d6 100644 --- a/zscript/universalreloader/items/universalReloader.zsc +++ b/zscript/universalreloader/items/universalReloader.zsc @@ -138,7 +138,7 @@ class HDUniversalReloader : HDWeapon } } - if (hd_debug) console.printf("Can assemble "..recipe.AmmoClass.GetClassName().."? "..canCraft); + if (hd_debug) console.printf("Can assemble "..(recipe ? recipe.AmmoClass.GetClassName() : 'nothing').."? "..canCraft); return canCraft; } @@ -147,7 +147,7 @@ class HDUniversalReloader : HDWeapon { let canCraft = owner && recipe && owner.countInv(recipe.AmmoClass) > 0; - if (hd_debug) console.printf("Can disassemble "..recipe.AmmoClass.GetClassName().."? "..canCraft); + if (hd_debug) console.printf("Can disassemble "..(recipe ? recipe.AmmoClass.GetClassName() : 'nothing').."? "..canCraft); return canCraft; }