[MIRROR] Prevents NAN amounts infecting the chemistry reagent container system [MDB IGNORE] (#15482)

* Prevents NAN amounts infecting the chemistry reagent container system (#69017)

* Don't allow NAN into the reagent holders, and better reporting on add reagent and remove reagent

* Replace admin message with stack_trace and return and improve math defines to check for finite numbers

* Refactor things to use these new defines, attempts to fix unit tests by filtering out <= 0 amounts first

Co-authored-by: Aleksej Komarov <stylemistake@ gmail.com>

* Prevents NAN amounts infecting the chemistry reagent container system

Co-authored-by: oranges <email@oranges.net.nz>
Co-authored-by: Aleksej Komarov <stylemistake@ gmail.com>
This commit is contained in:
SkyratBot
2022-08-08 15:39:35 -07:00
committed by GitHub
co-authored by Aleksej Komarov oranges
parent 7a839dc37f
commit 8b2badefef
5 changed files with 23 additions and 16 deletions
+2 -1
View File
@@ -357,7 +357,8 @@
return
if(!is_valid_recipe(recipe, recipes)) //href exploit protection
return
if(!multiplier || multiplier < 1) //href exploit protection
if(!multiplier || multiplier < 1 || !IS_FINITE(multiplier)) //href exploit protection
stack_trace("Invalid multiplier value in stack creation [multiplier], [usr] is likely attempting an exploit")
return
if(!building_checks(builder, recipe, multiplier))
return