[MIRROR] Converts all A && A.B into A?.B (#1292)

* 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.

* Converts all A && A.B into A?.B

Co-authored-by: ZeWaka <zewakagamer@gmail.com>
This commit is contained in:
SkyratBot
2020-10-13 23:19:25 +02:00
committed by GitHub
co-authored by ZeWaka
parent ce11cae6b7
commit b8d9874c27
214 changed files with 377 additions and 377 deletions
+1 -1
View File
@@ -310,7 +310,7 @@
return
var/mob/living/owner = parent
var/datum/hud/hud = owner.hud_used
if(hud && hud.infodisplay)
if(hud?.infodisplay)
hud.infodisplay -= screen_obj
QDEL_NULL(screen_obj)
+1 -1
View File
@@ -119,7 +119,7 @@ handles linking back and forth.
return COMPONENT_BLOCK_TOOL_ATTACK
/datum/component/remote_materials/proc/on_hold()
return silo && silo.holds["[get_area(parent)]/[category]"]
return silo?.holds["[get_area(parent)]/[category]"]
/datum/component/remote_materials/proc/silo_log(obj/machinery/M, action, amount, noun, list/mats)
if (silo)
+1 -1
View File
@@ -635,7 +635,7 @@
to_chat(M, "<span class='warning'>[I] is too big for [host]!</span>")
return FALSE
var/datum/component/storage/biggerfish = real_location.loc.GetComponent(/datum/component/storage)
if(biggerfish && biggerfish.max_w_class < max_w_class)//return false if we are inside of another container, and that container has a smaller max_w_class than us (like if we're a bag in a box)
if(biggerfish && biggerfish.max_w_class < max_w_class) //return false if we are inside of another container, and that container has a smaller max_w_class than us (like if we're a bag in a box)
if(!stop_messages)
to_chat(M, "<span class='warning'>[I] can't fit in [host] while [real_location.loc] is in the way!</span>")
return FALSE