mirror of
https://github.com/Aurorastation/Aurora.3.git
synced 2026-08-30 16:38:22 +01:00
New opendream pragmas (#20260)
Enabled new opendream pragmas Fixed some runtime access check operators (`:`) around the codebase (not all, some are unfixable as they're used in macros) No player facing changes (hopefully)
This commit is contained in:
@@ -35,21 +35,22 @@ SUBSYSTEM_DEF(falling)
|
||||
// The call_fall checks that are executed for every atom forever. These
|
||||
// should not be overwritten/there shouldn't be a need to overwrite them.
|
||||
// For specialty conditions, edit CanZPass and can_fall procs.
|
||||
if (!isturf(victim.loc))
|
||||
var/turf/mob_loc = victim.loc
|
||||
if (!isturf(mob_loc))
|
||||
REMOVE_AND_CONTINUE
|
||||
|
||||
// Get the below turf.
|
||||
var/turf/T = get_turf(victim)
|
||||
var/turf/below = GET_TURF_BELOW(T)
|
||||
var/turf/below = GET_TURF_BELOW(mob_loc)
|
||||
if (!below)
|
||||
REMOVE_AND_CONTINUE
|
||||
|
||||
// Check if we can fall through the current tile and onto the next one.
|
||||
if (!victim.loc:CanZPass(victim, DOWN) || !below.CanZPass(victim, DOWN))
|
||||
if (!mob_loc.CanZPass(victim, DOWN) || !below.CanZPass(victim, DOWN))
|
||||
REMOVE_AND_CONTINUE
|
||||
|
||||
// Check if the victim's current position is affected by gravity.
|
||||
if (!victim.loc.loc:has_gravity())
|
||||
var/area/mob_area = get_area(mob_loc)
|
||||
if (!mob_area.has_gravity())
|
||||
REMOVE_AND_CONTINUE
|
||||
|
||||
// Thrown objects don't fall, generally speaking.
|
||||
@@ -75,40 +76,43 @@ SUBSYSTEM_DEF(falling)
|
||||
// Invokes fall_through() after the atom is moved to
|
||||
// its new destination this cycle. Immediately invokes fall_impact and
|
||||
// fall_collateral if the next turf is not open space.
|
||||
if (isopenturf(victim.loc) && victim.loc:is_hole)
|
||||
victim.begin_falling(victim.loc, below)
|
||||
victim.forceMove(below)
|
||||
if(victim.pulledby && victim.pulledby.z != victim.z)
|
||||
var/mob/M = victim.pulledby
|
||||
M.stop_pulling()
|
||||
if (isopenturf(victim.loc))
|
||||
var/turf/simulated/open/mob_openturf = victim.loc
|
||||
|
||||
if (locate(/obj/structure/stairs) in victim.loc) // If there's stairs, we're probably going down them.
|
||||
if (falling[victim] <= 1) // Just moving down a flight, skip damage.
|
||||
victim.multiz_falling = 0
|
||||
falling -= victim
|
||||
for(var/obj/item/grab/grab in victim)
|
||||
if(grab.affecting)
|
||||
grab.affecting.forceMove(victim.loc)
|
||||
if(mob_openturf.is_hole)
|
||||
victim.begin_falling(victim.loc, below)
|
||||
victim.forceMove(below)
|
||||
if(victim.pulledby && victim.pulledby.z != victim.z)
|
||||
var/mob/M = victim.pulledby
|
||||
M.stop_pulling()
|
||||
|
||||
if (locate(/obj/structure/stairs) in victim.loc) // If there's stairs, we're probably going down them.
|
||||
if (falling[victim] <= 1) // Just moving down a flight, skip damage.
|
||||
victim.multiz_falling = 0
|
||||
falling -= victim
|
||||
for(var/obj/item/grab/grab in victim)
|
||||
if(grab.affecting)
|
||||
grab.affecting.forceMove(victim.loc)
|
||||
else
|
||||
// Falling more than a level, fuck 'em up.
|
||||
victim.fall_impact(falling[victim], FALSE)
|
||||
victim.fall_collateral(falling[victim], FALSE)
|
||||
victim.multiz_falling = 0
|
||||
falling -= victim
|
||||
|
||||
else if (isopenturf(victim.loc))
|
||||
victim.fall_through()
|
||||
else
|
||||
// Falling more than a level, fuck 'em up.
|
||||
// This is a lookahead. It removes any lag from being moved onto
|
||||
// the destination turf, and calling fall_impact.
|
||||
victim.fall_impact(falling[victim], FALSE)
|
||||
victim.fall_collateral(falling[victim], FALSE)
|
||||
victim.multiz_falling = 0
|
||||
falling -= victim
|
||||
|
||||
else if (isopenturf(victim.loc))
|
||||
victim.fall_through()
|
||||
else
|
||||
// This is a lookahead. It removes any lag from being moved onto
|
||||
// the destination turf, and calling fall_impact.
|
||||
victim.fall_impact(falling[victim], FALSE)
|
||||
victim.fall_collateral(falling[victim], FALSE)
|
||||
victim.multiz_falling = 0
|
||||
falling -= victim
|
||||
|
||||
if (MC_TICK_CHECK)
|
||||
return
|
||||
continue
|
||||
if (MC_TICK_CHECK)
|
||||
return
|
||||
continue
|
||||
|
||||
// This shouldn't actually happen. But for safety, here it is.
|
||||
victim.fall_impact(falling[victim], FALSE)
|
||||
|
||||
@@ -82,8 +82,10 @@ PROCESSING_SUBSYSTEM_DEF(airflow)
|
||||
continue
|
||||
|
||||
step_towards(target, target.airflow_dest)
|
||||
if (ismob(target) && target:client)
|
||||
target:setMoveCooldown(vsc.airflow_mob_slowdown)
|
||||
if(ismob(target))
|
||||
var/mob/target_mob = target
|
||||
if(target_mob.client)
|
||||
target_mob:setMoveCooldown(vsc.airflow_mob_slowdown)
|
||||
|
||||
if (MC_TICK_CHECK)
|
||||
return
|
||||
|
||||
@@ -6,7 +6,7 @@ SUBSYSTEM_DEF(vis_contents_update)
|
||||
runlevels = RUNLEVEL_LOBBY | RUNLEVELS_DEFAULT
|
||||
var/list/queue_refs = list()
|
||||
|
||||
/datum/controller/subsystem/vis_contents_update/stat_entry()
|
||||
/datum/controller/subsystem/vis_contents_update/stat_entry(msg)
|
||||
..("Queue: [queue_refs.len]")
|
||||
|
||||
/datum/controller/subsystem/vis_contents_update/Initialize()
|
||||
@@ -24,17 +24,15 @@ SUBSYSTEM_DEF(vis_contents_update)
|
||||
if(!queue_refs.len)
|
||||
can_fire = FALSE
|
||||
return
|
||||
var/i = 0
|
||||
while (i < queue_refs.len)
|
||||
i++
|
||||
var/atom/A = queue_refs[i]
|
||||
if(QDELETED(A))
|
||||
for(var/i in 1 to length(queue_refs))
|
||||
var/atom/movable/MA = queue_refs[i]
|
||||
if(QDELETED(MA))
|
||||
continue
|
||||
if(Master.map_loading)
|
||||
queue_refs.Cut(1, i+1)
|
||||
return
|
||||
A.vis_update_queued = FALSE
|
||||
A.update_vis_contents(force_no_queue = TRUE)
|
||||
MA.vis_update_queued = FALSE
|
||||
MA.update_vis_contents(force_no_queue = TRUE)
|
||||
if (no_mc_tick)
|
||||
CHECK_TICK
|
||||
else if (MC_TICK_CHECK)
|
||||
@@ -52,24 +50,55 @@ SUBSYSTEM_DEF(vis_contents_update)
|
||||
SSvis_contents_update.queue_refs.Add(src)
|
||||
SSvis_contents_update.can_fire = TRUE
|
||||
|
||||
// Horrible colon syntax below is because vis_contents
|
||||
// exists in /atom.vars, but will not compile. No idea why.
|
||||
|
||||
/atom/proc/add_vis_contents(adding)
|
||||
src:vis_contents |= adding
|
||||
SHOULD_CALL_PARENT(FALSE)
|
||||
crash_with("Turfs, movable atoms, and images can be given a list of atoms, but not atmos themselves!")
|
||||
|
||||
/atom/movable/add_vis_contents(adding)
|
||||
vis_contents |= adding
|
||||
|
||||
/turf/add_vis_contents(adding)
|
||||
vis_contents |= adding
|
||||
|
||||
|
||||
/atom/proc/remove_vis_contents(removing)
|
||||
src:vis_contents -= removing
|
||||
SHOULD_CALL_PARENT(FALSE)
|
||||
crash_with("Turfs, movable atoms, and images can be given a list of atoms, but not atmos themselves!")
|
||||
|
||||
/atom/movable/remove_vis_contents(removing)
|
||||
vis_contents -= removing
|
||||
|
||||
/turf/remove_vis_contents(removing)
|
||||
vis_contents -= removing
|
||||
|
||||
|
||||
/atom/proc/clear_vis_contents()
|
||||
src:vis_contents = null
|
||||
SHOULD_CALL_PARENT(FALSE)
|
||||
crash_with("Turfs, movable atoms, and images can be given a list of atoms, but not atmos themselves!")
|
||||
|
||||
/atom/movable/clear_vis_contents()
|
||||
vis_contents = null
|
||||
|
||||
/turf/clear_vis_contents()
|
||||
vis_contents = null
|
||||
|
||||
|
||||
/atom/proc/set_vis_contents(list/adding)
|
||||
src:vis_contents = adding
|
||||
SHOULD_CALL_PARENT(FALSE)
|
||||
crash_with("Turfs, movable atoms, and images can be given a list of atoms, but not atmos themselves!")
|
||||
|
||||
/atom/movable/set_vis_contents(list/adding)
|
||||
vis_contents = adding
|
||||
|
||||
/turf/set_vis_contents(list/adding)
|
||||
vis_contents = adding
|
||||
|
||||
|
||||
/atom/proc/get_vis_contents_to_add()
|
||||
return
|
||||
|
||||
/atom/proc/update_vis_contents(force_no_queue = FALSE)
|
||||
/atom/movable/proc/update_vis_contents(force_no_queue = FALSE)
|
||||
if(!force_no_queue && (!SSvis_contents_update.initialized || TICK_CHECK))
|
||||
queue_vis_contents_update()
|
||||
return
|
||||
@@ -77,7 +106,7 @@ SUBSYSTEM_DEF(vis_contents_update)
|
||||
var/new_vis_contents = get_vis_contents_to_add()
|
||||
if(length(new_vis_contents))
|
||||
set_vis_contents(new_vis_contents)
|
||||
else if(length(src:vis_contents))
|
||||
else if(length(vis_contents))
|
||||
clear_vis_contents()
|
||||
|
||||
/image/proc/add_vis_contents(adding)
|
||||
|
||||
Reference in New Issue
Block a user