mirror of
https://github.com/Bubberstation/Bubberstation.git
synced 2026-08-29 08:08:49 +01:00
[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:
@@ -79,7 +79,7 @@ SUBSYSTEM_DEF(economy)
|
||||
for(var/account in bank_accounts)
|
||||
var/datum/bank_account/bank_account = account
|
||||
bank_account.payday(1)
|
||||
if(bank_account && bank_account.account_job)
|
||||
if(bank_account?.account_job)
|
||||
temporary_total += (bank_account.account_job.paycheck * STARTING_PAYCHECKS)
|
||||
if(!istype(bank_account, /datum/bank_account/department))
|
||||
station_total += bank_account.account_balance
|
||||
|
||||
@@ -77,7 +77,7 @@ SUBSYSTEM_DEF(job)
|
||||
|
||||
/datum/controller/subsystem/job/proc/AssignRole(mob/dead/new_player/player, rank, latejoin = FALSE)
|
||||
JobDebug("Running AR, Player: [player], Rank: [rank], LJ: [latejoin]")
|
||||
if(player && player.mind && rank)
|
||||
if(player?.mind && rank)
|
||||
var/datum/job/job = GetJob(rank)
|
||||
if(!job)
|
||||
return FALSE
|
||||
|
||||
@@ -364,7 +364,7 @@ SUBSYSTEM_DEF(persistence)
|
||||
//asert globchems done
|
||||
for(var/randomized_type in subtypesof(/datum/chemical_reaction/randomized))
|
||||
var/datum/chemical_reaction/randomized/R = get_chemical_reaction(randomized_type) //ew, would be nice to add some simple tracking
|
||||
if(R && R.persistent)
|
||||
if(R?.persistent)
|
||||
var/recipe_data = list()
|
||||
recipe_data["timestamp"] = R.created
|
||||
recipe_data["required_reagents"] = R.required_reagents
|
||||
|
||||
@@ -714,7 +714,7 @@ SUBSYSTEM_DEF(shuttle)
|
||||
|
||||
var/list/force_memory = preview_shuttle.movement_force
|
||||
preview_shuttle.movement_force = list("KNOCKDOWN" = 0, "THROW" = 0)
|
||||
preview_shuttle.mode = SHUTTLE_PREARRIVAL//No idle shuttle moving. Transit dock get removed if shuttle moves too long.
|
||||
preview_shuttle.mode = SHUTTLE_PREARRIVAL//No idle shuttle moving. Transit dock get removed if shuttle moves too long.
|
||||
preview_shuttle.initiate_docking(D)
|
||||
preview_shuttle.movement_force = force_memory
|
||||
|
||||
|
||||
@@ -42,7 +42,7 @@ SUBSYSTEM_DEF(tgui)
|
||||
var/datum/tgui/ui = current_run[current_run.len]
|
||||
current_run.len--
|
||||
// TODO: Move user/src_object check to process()
|
||||
if(ui && ui.user && ui.src_object)
|
||||
if(ui?.user && ui.src_object)
|
||||
ui.process(wait * 0.1)
|
||||
else
|
||||
open_uis.Remove(ui)
|
||||
@@ -191,7 +191,7 @@ SUBSYSTEM_DEF(tgui)
|
||||
return count
|
||||
for(var/datum/tgui/ui in open_uis_by_src[key])
|
||||
// Check if UI is valid.
|
||||
if(ui && ui.src_object && ui.user && ui.src_object.ui_host(ui.user))
|
||||
if(ui?.src_object && ui.user && ui.src_object.ui_host(ui.user))
|
||||
ui.process(wait * 0.1, force = 1)
|
||||
count++
|
||||
return count
|
||||
@@ -213,7 +213,7 @@ SUBSYSTEM_DEF(tgui)
|
||||
return count
|
||||
for(var/datum/tgui/ui in open_uis_by_src[key])
|
||||
// Check if UI is valid.
|
||||
if(ui && ui.src_object && ui.user && ui.src_object.ui_host(ui.user))
|
||||
if(ui?.src_object && ui.user && ui.src_object.ui_host(ui.user))
|
||||
ui.close()
|
||||
count++
|
||||
return count
|
||||
@@ -230,7 +230,7 @@ SUBSYSTEM_DEF(tgui)
|
||||
for(var/key in open_uis_by_src)
|
||||
for(var/datum/tgui/ui in open_uis_by_src[key])
|
||||
// Check if UI is valid.
|
||||
if(ui && ui.src_object && ui.user && ui.src_object.ui_host(ui.user))
|
||||
if(ui?.src_object && ui.user && ui.src_object.ui_host(ui.user))
|
||||
ui.close()
|
||||
count++
|
||||
return count
|
||||
|
||||
@@ -456,7 +456,7 @@ SUBSYSTEM_DEF(ticker)
|
||||
if(5) //every 5 ticks check if there is a slot available
|
||||
listclearnulls(queued_players)
|
||||
if(living_player_count() < hpc)
|
||||
if(next_in_line && next_in_line.client)
|
||||
if(next_in_line?.client)
|
||||
to_chat(next_in_line, "<span class='userdanger'>A slot has opened! You have approximately 20 seconds to join. <a href='?src=[REF(next_in_line)];late_join=override'>\>\>Join Game\<\<</a></span>")
|
||||
SEND_SOUND(next_in_line, sound('sound/misc/notice1.ogg'))
|
||||
next_in_line.LateChoices()
|
||||
|
||||
Reference in New Issue
Block a user