Skip to content

Commit

Permalink
isnan is a 515 feature
Browse files Browse the repository at this point in the history
isnum returning true for nan is a 515 feature...
  • Loading branch information
Drulikar committed Feb 2, 2024
1 parent 7846f41 commit d4174de
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions code/game/objects/items/stacks/stack.dm
Original file line number Diff line number Diff line change
Expand Up @@ -144,15 +144,21 @@ 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"])
var/datum/stack_recipe_list/srl = recipes_list[text2num(href_list["sublist"])]
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)
Expand Down

0 comments on commit d4174de

Please sign in to comment.