From d4174dede4a5ec008cdc0e74618ab86ce549c8c9 Mon Sep 17 00:00:00 2001 From: Drulikar Date: Thu, 1 Feb 2024 18:53:06 -0800 Subject: [PATCH] isnan is a 515 feature isnum returning true for nan is a 515 feature... --- code/game/objects/items/stacks/stack.dm | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/code/game/objects/items/stacks/stack.dm b/code/game/objects/items/stacks/stack.dm index ab56882de6f0..f8a6af3cf24f 100644 --- a/code/game/objects/items/stacks/stack.dm +++ b/code/game/objects/items/stacks/stack.dm @@ -144,7 +144,9 @@ Also change the icon to reflect the amount of sheets, if possible.*/ list_recipes(usr, text2num(href_list["sublist"])) if(href_list["make"]) - if(amount < 1) qdel(src) //Never should happen + if(amount < 1) + qdel(src) //Never should happen + return var/list/recipes_list = recipes if(href_list["sublist"]) @@ -152,7 +154,11 @@ Also change the icon to reflect the amount of sheets, if possible.*/ recipes_list = srl.recipes var/datum/stack_recipe/R = recipes_list[text2num(href_list["make"])] var/multiplier = text2num(href_list["multiplier"]) - if(!isnum(multiplier)) + if(multiplier != multiplier) // isnan + message_admins("[key_name_admin(usr)] has attempted to multiply [src] with NaN") + return + if(!isnum(multiplier)) // this used to block nan... + message_admins("[key_name_admin(usr)] has attempted to multiply [src] with !isnum") return multiplier = round(multiplier) if(multiplier < 1)