mirror of
https://github.com/Aurorastation/Aurora.3.git
synced 2026-08-25 05:51:56 +01:00
Gear loadout sanity checking.
Adds gear loadout sanity checking to reduce the risk of https://github.com/PolarisSS13/Polaris/issues/376 from happening, as well as ' /datum/'.
This commit is contained in:
@@ -18,7 +18,17 @@ var/global/list/gear_datums = list()
|
||||
|
||||
//create a list of gear datums to sort
|
||||
for(var/type in typesof(/datum/gear)-/datum/gear)
|
||||
var/datum/gear/G = new type()
|
||||
var/datum/gear/G = type
|
||||
if(!initial(G.display_name))
|
||||
error("Loadout - Missing display name: [G]")
|
||||
continue
|
||||
if(!initial(G.cost))
|
||||
error("Loadout - Missing cost: [G]")
|
||||
continue
|
||||
if(!initial(G.path))
|
||||
error("Loadout - Missing path definition: [G]")
|
||||
continue
|
||||
G = new G()
|
||||
|
||||
var/category = (G.sort_category in sort_categories)? G.sort_category : "unknown"
|
||||
sort_categories[category][G.display_name] = G
|
||||
@@ -127,13 +137,13 @@ var/global/list/gear_datums = list()
|
||||
cost = 1
|
||||
slot = slot_head
|
||||
|
||||
/datum/gear/grcap
|
||||
/datum/gear/grcap
|
||||
display_name = "cap, grey"
|
||||
path = /obj/item/clothing/head/soft/grey
|
||||
cost = 1
|
||||
slot = slot_head
|
||||
|
||||
/datum/gear/ocap
|
||||
/datum/gear/ocap
|
||||
display_name = "cap, orange"
|
||||
path = /obj/item/clothing/head/soft/orange
|
||||
cost = 1
|
||||
@@ -205,7 +215,7 @@ var/global/list/gear_datums = list()
|
||||
cost = 1
|
||||
slot = slot_head
|
||||
|
||||
/datum/gear/bowler
|
||||
/datum/gear/bowler
|
||||
display_name = "hat, bowler"
|
||||
path = /obj/item/clothing/head/bowler
|
||||
cost = 1
|
||||
|
||||
Reference in New Issue
Block a user