diff --git a/code/controllers/subsystem/air.dm b/code/controllers/subsystem/air.dm index 2a59558bcd..52d2fe45cd 100644 --- a/code/controllers/subsystem/air.dm +++ b/code/controllers/subsystem/air.dm @@ -239,7 +239,6 @@ SUBSYSTEM_DEF(air) if (MC_TICK_CHECK) return - /datum/controller/subsystem/air/proc/remove_from_active(turf/open/T) active_turfs -= T SSair_turfs.currentrun -= T @@ -257,7 +256,7 @@ SUBSYSTEM_DEF(air) #ifdef VISUALIZE_ACTIVE_TURFS T.add_atom_colour("#00ff00", TEMPORARY_COLOUR_PRIORITY) #endif - T.excited = 1 + T.excited = TRUE active_turfs |= T SSair_turfs.currentrun |= T if(blockchanges && T.excited_group) diff --git a/code/controllers/subsystem/air_turfs.dm b/code/controllers/subsystem/air_turfs.dm index 2902940bf9..9dd41aede5 100644 --- a/code/controllers/subsystem/air_turfs.dm +++ b/code/controllers/subsystem/air_turfs.dm @@ -11,7 +11,6 @@ SUBSYSTEM_DEF(air_turfs) /datum/controller/subsystem/air_turfs/fire(resumed = 0) var/fire_count = times_fired - //cache for sanic speed if (!resumed) src.currentrun = SSair.active_turfs.Copy() //cache for sanic speed (lists are references anyways) diff --git a/code/controllers/subsystem/time_track.dm b/code/controllers/subsystem/time_track.dm index 165386694d..ac09c3ce65 100644 --- a/code/controllers/subsystem/time_track.dm +++ b/code/controllers/subsystem/time_track.dm @@ -45,4 +45,4 @@ SUBSYSTEM_DEF(time_track) last_tick_byond_time = current_byondtime last_tick_tickcount = current_tickcount SSblackbox.record_feedback("associative", "time_dilation_current", 1, list("[SQLtime()]" = list("current" = "[time_dilation_current]", "avg_fast" = "[time_dilation_avg_fast]", "avg" = "[time_dilation_avg]", "avg_slow" = "[time_dilation_avg_slow]"))) - time_dilation_text = "Time Dilation: [round(SStime_track.time_dilation_current,1)]% AVG:([round(SStime_track.time_dalilation_avg_fast,1)]%, [round(SStime_track.time_dilation_avg,1)]%, [round(SStime_track.time_dilation_avg_slow,1)]%)" + time_dilation_text = "Time Dilation: [round(time_dilation_current,1)]% AVG:([round(time_dilation_avg_fast,1)]%, [round(time_dilation_avg,1)]%, [round(time_dilation_avg_slow,1)]%)" diff --git a/code/modules/atmospherics/gasmixtures/gas_mixture.dm b/code/modules/atmospherics/gasmixtures/gas_mixture.dm index 12efa01a38..f59bf23b71 100644 --- a/code/modules/atmospherics/gasmixtures/gas_mixture.dm +++ b/code/modules/atmospherics/gasmixtures/gas_mixture.dm @@ -310,26 +310,22 @@ GLOBAL_LIST_INIT(meta_gas_fusions, meta_gas_fusion_list()) /datum/gas_mixture/compare(datum/gas_mixture/sample) var/list/sample_gases = sample.gases //accessing datum vars is slower than proc vars var/list/cached_gases = gases - - for(var/id in cached_gases | sample_gases) // compare gases from either mixture - var/gas_moles = cached_gases[id] - var/sample_moles = sample_gases[id] - var/delta = abs(gas_moles - sample_moles) - if(delta > MINIMUM_MOLES_DELTA_TO_MOVE && \ - delta > gas_moles * MINIMUM_AIR_RATIO_TO_MOVE) - return id - + var/list/combined = cached_gases | sample_gases + // Do not use TOTAL_MOLES, that's an unnecessary iteration. var/our_moles - TOTAL_MOLES(cached_gases, our_moles) - if(our_moles > MINIMUM_MOLES_DELTA_TO_MOVE) - var/temp = temperature - var/sample_temp = sample.temperature - - var/temperature_delta = abs(temp - sample_temp) - if(temperature_delta > MINIMUM_TEMPERATURE_DELTA_TO_SUSPEND) - return "temp" - - return "" + // Declarations are expensive. + var/us + var/them + var/diff + for(var/id in combined) + us = cached_gases[id] + them = sample_gases[id] + diff = abs(gas_moles - sample_moles) + if(diff > MINIMUM_MOLES_DELTA_TO_MOVE && diff > gas_moles * MINIMUM_AIR_RATIO_TO_MOVE) + return id + our_moles += us + if((our_moles > MINIMUM_MOLES_DELTA_TO_MOVE) && (abs(temperature - sample.temperature) > MINIMUM_TEMPERATURE_DELTA_TO_SUSPEN)) + return "temp" /datum/gas_mixture/react(datum/holder) . = NO_REACTION diff --git a/code/modules/mob/mob.dm b/code/modules/mob/mob.dm index 9c4c15f9af..7f4274d43e 100644 --- a/code/modules/mob/mob.dm +++ b/code/modules/mob/mob.dm @@ -576,7 +576,7 @@ GLOBAL_VAR_INIT(exploit_warn_spam_prevention, 0) var/list/L = list() L += "Ping: [round(client.lastping,1)]ms (Avg: [round(client.avgping,1)]ms)" L += SSmapping.stat_map_name - L += "Round ID: [GLOB.round_id || "NULL"]") + L += "Round ID: [GLOB.round_id || "NULL"]" L += SStime_track.stat_time_text L += SSshuttle.emergency_shuttle_stat_text stat(null, "[L.Join("\n")]") diff --git a/code/modules/mob/mob_movement.dm b/code/modules/mob/mob_movement.dm index 5f217d67fd..4c7eba348d 100644 --- a/code/modules/mob/mob_movement.dm +++ b/code/modules/mob/mob_movement.dm @@ -21,15 +21,15 @@ mob.dropItemToGround(mob.get_active_held_item()) return -/client/proc/Move_object(direct) +/client/proc/Move_object(direction) if(mob && mob.control_object) if(mob.control_object.density) - step(mob.control_object,direct) + step(mob.control_object,direction) if(!mob.control_object) return - mob.control_object.setDir(direct) + mob.control_object.setDir(direction) else - mob.control_object.forceMove(get_step(mob.control_object,direct)) + mob.control_object.forceMove(get_step(mob.control_object,direction)) #define MOVEMENT_DELAY_BUFFER 0.75 #define MOVEMENT_DELAY_BUFFER_DELTA 1.25 @@ -48,9 +48,9 @@ return FALSE if(mob.control_object) - return Move_object(direct) + return Move_object(direction) if(!isliving(mob)) - return mob.Move(n, direct) + return mob.Move(n, direction) if(mob.stat == DEAD) mob.ghostize() return FALSE @@ -59,29 +59,29 @@ var/mob/living/L = mob //Already checked for isliving earlier if(L.incorporeal_move) //Move though walls - Process_Incorpmove(direct) + Process_Incorpmove(direction) return FALSE if(mob.remote_control) //we're controlling something, our movement is relayed to it - return mob.remote_control.relaymove(mob, direct) + return mob.remote_control.relaymove(mob, direction) if(isAI(mob)) - return AIMove(n,direct,mob) + return AIMove(n,direction,mob) if(Process_Grab()) //are we restrained by someone's grip? return if(mob.buckled) //if we're buckled to something, tell it we moved. - return mob.buckled.relaymove(mob, direct) + return mob.buckled.relaymove(mob, direction) if(!mob.canmove) return FALSE if(isobj(mob.loc) || ismob(mob.loc)) //Inside an object, tell it we moved var/atom/O = mob.loc - return O.relaymove(mob, direct) + return O.relaymove(mob, direction) - if(!mob.Process_Spacemove(direct)) + if(!mob.Process_Spacemove(direction)) return FALSE //We are now going to move var/add_delay = mob.movement_delay() @@ -96,16 +96,16 @@ if(L.confused > 40) newdir = pick(GLOB.alldirs) else if(prob(L.confused * 1.5)) - newdir = angle2dir(dir2angle(direct) + pick(90, -90)) + newdir = angle2dir(dir2angle(direction) + pick(90, -90)) else if(prob(L.confused * 3)) - newdir = angle2dir(dir2angle(direct) + pick(45, -45)) + newdir = angle2dir(dir2angle(direction) + pick(45, -45)) if(newdir) - direct = newdir - n = get_step(L, direct) + direction = newdir + n = get_step(L, direction) . = ..() - if((direct & (direct - 1)) && mob.loc == n) //moved diagonally successfully + if((direction & (direction - 1)) && mob.loc == n) //moved diagonally successfully add_delay *= 2 if(mob.loc != oldloc) move_delay += add_delay @@ -114,7 +114,7 @@ mob.throwing.finalize(FALSE) for(var/obj/O in mob.user_movement_hooks) - O.intercept_user_move(direct, mob, n, oldloc) + O.intercept_user_move(direction, mob, n, oldloc) var/atom/movable/P = mob.pulling if(P && !ismob(P) && P.density) @@ -138,22 +138,22 @@ ///Process_Incorpmove ///Called by client/Move() ///Allows mobs to run though walls -/client/proc/Process_Incorpmove(direct) +/client/proc/Process_Incorpmove(direction) var/turf/mobloc = get_turf(mob) if(!isliving(mob)) return var/mob/living/L = mob switch(L.incorporeal_move) if(INCORPOREAL_MOVE_BASIC) - var/T = get_step(L,direct) + var/T = get_step(L,direction) if(T) L.forceMove(T) - L.setDir(direct) + L.setDir(direction) if(INCORPOREAL_MOVE_SHADOW) if(prob(50)) var/locx var/locy - switch(direct) + switch(direction) if(NORTH) locx = mobloc.x locy = (mobloc.y+2) @@ -187,12 +187,12 @@ break else new /obj/effect/temp_visual/dir_setting/ninja/shadow(mobloc, L.dir) - var/T = get_step(L,direct) + var/T = get_step(L,direction) if(T) L.forceMove(T) - L.setDir(direct) + L.setDir(direction) if(INCORPOREAL_MOVE_JAUNT) //Incorporeal move, but blocked by holy-watered tiles and salt piles. - var/turf/open/floor/stepTurf = get_step(L, direct) + var/turf/open/floor/stepTurf = get_step(L, direction) if(stepTurf) for(var/obj/effect/decal/cleanable/salt/S in stepTurf) to_chat(L, "[S] bars your passage!") @@ -209,7 +209,7 @@ return L.forceMove(stepTurf) - L.setDir(direct) + L.setDir(direction) return TRUE