[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
+2 -2
View File
@@ -330,7 +330,7 @@
var/obj/item/organ/cyberimp/arm/flash/I = null
/obj/item/assembly/flash/armimplant/burn_out()
if(I && I.owner)
if(I?.owner)
to_chat(I.owner, "<span class='warning'>Your photon projector implant overheats and deactivates!</span>")
I.Retract()
overheat = TRUE
@@ -338,7 +338,7 @@
/obj/item/assembly/flash/armimplant/try_use_flash(mob/user = null)
if(overheat)
if(I && I.owner)
if(I?.owner)
to_chat(I.owner, "<span class='warning'>Your photon projector is running too hot to be used again so quickly!</span>")
return FALSE
overheat = TRUE
+1 -1
View File
@@ -43,7 +43,7 @@
return
var/atom/A = src
if(connected && connected.holder)
if(connected?.holder)
A = connected.holder
for(A, A && !ismob(A), A=A.loc);
// like get_turf(), but for mobs.