mirror of
https://github.com/PolarisSS13/Polaris.git
synced 2025-12-29 03:21:42 +00:00
Personal Crafting & Dependencies
This commit is contained in:
@@ -64,4 +64,23 @@
|
||||
return b_score - a_score
|
||||
|
||||
/proc/cmp_typepaths_asc(A, B)
|
||||
return sorttext("[B]","[A]")
|
||||
return sorttext("[B]","[A]")
|
||||
|
||||
/**
|
||||
* Sorts crafting recipe requirements before the crafting recipe is inserted into GLOB.crafting_recipes
|
||||
*
|
||||
* Prioritises [/datum/reagent] to ensure reagent requirements are always processed first when crafting.
|
||||
* This prevents any reagent_containers from being consumed before the reagents they contain, which can
|
||||
* lead to runtimes and item duplication when it happens.
|
||||
*/
|
||||
/proc/cmp_crafting_req_priority(A, B)
|
||||
var/lhs
|
||||
var/rhs
|
||||
|
||||
lhs = ispath(A, /datum/reagent) ? 0 : 1
|
||||
rhs = ispath(B, /datum/reagent) ? 0 : 1
|
||||
|
||||
return lhs - rhs
|
||||
|
||||
/proc/cmp_text_asc(a,b)
|
||||
return sorttext(b,a)
|
||||
|
||||
Reference in New Issue
Block a user