Use can_atmos_pass to reduce proc-calls in c_airblock()

- Add additional can_atmos_pass value ATMOS_PASS_PROC which indicates custom behavior requiring calling the CanZASPass proc.
  - The benefit being for the other three values we DON'T need to call CanZASPass at all!  We already know the behavior without the overhead of a proc call.
  - Obviously any atom with can_atmos_pass = ATMOS_PASS_PROC cannot now call ..() in CanZASPass() since the default behavior would be to (recursively) call CanZASPass()
  - This required re-numbering the constants, so I also fixed all code that assumed particular values for the constants.
- Switched all types which overrode CanZASPass with custom logic to be can_atmos_pass = ATMOS_PASS_PROC
- Changed /turf/c_airblock() to skip calling /atom/movable/c_airblock() for the three can_atmos_pass values that don't require calling the proc.
This commit is contained in:
Leshana
2020-04-30 14:50:57 -04:00
parent 5c752e79f4
commit 10b0323d6f
9 changed files with 34 additions and 17 deletions
@@ -8,10 +8,6 @@
return !P.can_hit_target(src, P.permutated, src == P.original, TRUE)
return (!mover.density || !density || lying)
// There is no need to override this if you're just going to unconditionally return TRUE. Set can_atmos_pass instead.
///mob/CanZASPass(turf/T, is_zone)
// return TRUE
/mob/living/SelfMove(turf/n, direct)
// If on walk intent, don't willingly step into hazardous tiles.
// Unless the walker is confused.
+1
View File
@@ -28,6 +28,7 @@
icon_state = "compressor"
anchored = TRUE
density = TRUE
can_atmos_pass = ATMOS_PASS_PROC
circuit = /obj/item/weapon/circuitboard/machine/power_compressor
var/obj/machinery/power/turbine/turbine
var/datum/gas_mixture/gas_contained