From 5ed5529ed540fa19a6dbbd061a52ec7c97d2f956 Mon Sep 17 00:00:00 2001 From: Jesusaves Date: Tue, 3 Jan 2023 16:26:07 -0300 Subject: Some missing errors and warnings from Bracco. This does not apply if the recipe has no refundable items. --- npc/020-5/bracco.txt | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/npc/020-5/bracco.txt b/npc/020-5/bracco.txt index 3716642d6..240197798 100644 --- a/npc/020-5/bracco.txt +++ b/npc/020-5/bracco.txt @@ -31,7 +31,7 @@ if (.@item <= 0) { // target item not found consolebug("ERROR, INVALID ITEM ID DETECTED at NewMeltdown"); - return; + return 0; } // More shady code by gumi for (.@inv = 0; .@inv < 9; ++.@inv) { @@ -40,10 +40,12 @@ if (.@size < 0) { if (.@size == -1) { // recipe does not exist + consolebug("ERROR, INVALID RECIPE DETECTED at NewMeltdown"); return 0; break; } // inventory does not exist + consolewarn("INVENTORY ERROR at NewMeltdown"); return 0; break; } @@ -76,6 +78,11 @@ .@ammo = rand2(.@mini, .@maxi); + if (.@ammo < 1) { + .@ammo = 1; + consolewarn("AMOUNT ERROR at NewMeltdown: %s", getitemname(.@recipe_item)); + } + getitem .@recipe_item, .@ammo; mesc l("* Acquired @@ @@!", .@ammo, getitemlink(.@recipe_item)); } -- cgit v1.2.3-60-g2f50