mirror of
https://github.com/Bubberstation/Bubberstation.git
synced 2026-08-28 15:47:15 +01:00
Converts A && A.B into A?.B (#54342)
Implements the ?. operator, replacing code like A && A.B with A?.B BYOND Ref: When reading A?.B, it's equivalent to A && A.B except that A is only evaluated once, even if it's a complex expression like a proc call.
This commit is contained in:
@@ -58,7 +58,7 @@
|
||||
new type(loc, max_amount, FALSE)
|
||||
if(!merge_type)
|
||||
merge_type = type
|
||||
if(custom_materials && custom_materials.len)
|
||||
if(custom_materials?.len)
|
||||
mats_per_unit = list()
|
||||
var/in_process_mat_list = custom_materials.Copy()
|
||||
for(var/i in custom_materials)
|
||||
@@ -242,7 +242,7 @@
|
||||
O.setDir(usr.dir)
|
||||
use(R.req_amount * multiplier)
|
||||
|
||||
if(R.applies_mats && custom_materials && custom_materials.len)
|
||||
if(R.applies_mats && custom_materials?.len)
|
||||
var/list/used_materials = list()
|
||||
for(var/i in custom_materials)
|
||||
used_materials[SSmaterials.GetMaterialRef(i)] = R.req_amount / R.res_amount * (MINERAL_MATERIAL_AMOUNT / custom_materials.len)
|
||||
|
||||
Reference in New Issue
Block a user