addresses reviews on the tram pr made after merge, fixes diagonal movement bugs (#68033)

This commit is contained in:
Kylerace
2022-07-16 21:44:41 -07:00
committed by GitHub
parent b31c605690
commit fe7513d282
65 changed files with 136 additions and 124 deletions
+1 -1
View File
@@ -59,7 +59,7 @@
/// from /obj/machinery/atmospherics/components/unary/cryo_cell/set_on(bool): (on)
#define COMSIG_CRYO_SET_ON "cryo_set_on"
/// from /obj/proc/make_unfrozen()
/// from /obj/proc/unfreeze()
#define COMSIG_OBJ_UNFREEZE "obj_unfreeze"
// /obj/machinery/atmospherics/components/binary/valve signals
+5 -5
View File
@@ -9,11 +9,11 @@
#define ON_BLUEPRINTS (1<<5) //Are we visible on the station blueprints at roundstart?
#define UNIQUE_RENAME (1<<6) // can you customize the description/name of the thing?
#define USES_TGUI (1<<7) //put on things that use tgui on ui_interact instead of custom/old UI.
#define BLOCK_Z_OUT_DOWN (1<<9) // Should this object block z falling from loc?
#define BLOCK_Z_OUT_UP (1<<10) // Should this object block z uprise from loc?
#define BLOCK_Z_IN_DOWN (1<<11) // Should this object block z falling from above?
#define BLOCK_Z_IN_UP (1<<12) // Should this object block z uprise from below?
#define NO_BUILD (1<<13) // Can we build on this object?
#define BLOCK_Z_OUT_DOWN (1<<8) // Should this object block z falling from loc?
#define BLOCK_Z_OUT_UP (1<<9) // Should this object block z uprise from loc?
#define BLOCK_Z_IN_DOWN (1<<10) // Should this object block z falling from above?
#define BLOCK_Z_IN_UP (1<<11) // Should this object block z uprise from below?
#define NO_BUILD (1<<12) // Can we build on this object?
// If you add new ones, be sure to add them to /obj/Initialize as well for complete mapping support
-6
View File
@@ -1084,12 +1084,6 @@ GLOBAL_LIST_EMPTY(friendly_animal_types)
/image/proc/setDir(newdir)
dir = newdir
GLOBAL_LIST_INIT(freon_color_matrix, list("#2E5E69", "#60A2A8", "#A1AFB1", rgb(0,0,0)))
//Assumes already frozed
/obj/proc/make_unfrozen()
SEND_SIGNAL(src, COMSIG_OBJ_UNFREEZE)
/// generates a filename for a given asset.
/// like generate_asset_name(), except returns the rsc reference and the rsc file hash as well as the asset name (sans extension)
/// used so that certain asset files dont have to be hashed twice
+1 -1
View File
@@ -42,7 +42,7 @@ SUBSYSTEM_DEF(mapping)
var/space_levels_so_far = 0
///list of all z level datums in the order of their z (z level 1 is at index 1, etc.)
var/list/datum/space_level/z_list
///list of all z level indices that form multiz connections and whether theyre linked up or down
///list of all z level indices that form multiz connections and whether theyre linked up or down.
///list of lists, inner lists are of the form: list("up or down link direction" = TRUE)
var/list/multiz_levels = list()
var/datum/space_level/transit
+1 -1
View File
@@ -73,7 +73,7 @@
last_blood_state = index
if(!wielder)
return
if(bloody_shoes[last_blood_state] <= BLOOD_FOOTPRINTS_MIN * 2)//need twice that amount to make footprints
if(bloody_shoes[index] <= BLOOD_FOOTPRINTS_MIN * 2)//need twice that amount to make footprints
UnregisterSignal(wielder, COMSIG_MOVABLE_MOVED)
else
RegisterSignal(wielder, COMSIG_MOVABLE_MOVED, .proc/on_moved, override = TRUE)
+1
View File
@@ -115,6 +115,7 @@
var/atom/movable/movable_parent = parent
movable_parent.setDir(old_dir)
movable_parent.inertia_moving = FALSE
if(movable_parent.Process_Spacemove(drifting_loop.direction, continuous_move = TRUE))
glide_to_halt(visual_delay)
return
+1 -1
View File
@@ -127,7 +127,7 @@
decrease = max(0, decrease)
if((is_wet() & TURF_WET_ICE) && t > T0C) //Ice melts into water!
for(var/obj/O in T.contents)
O.make_unfrozen()
O.unfreeze()
add_wet(TURF_WET_WATER, max_time_left())
dry(null, TURF_WET_ICE)
dry(null, ALL, FALSE, decrease)
+1 -1
View File
@@ -6,7 +6,7 @@
///whether we will override the turf if it forces no gravity
var/ignore_turf_gravity
/datum/element/forced_gravity/Attach(datum/target, gravity=1, ignore_turf_gravity = FALSE)
/datum/element/forced_gravity/Attach(datum/target, gravity = 1, ignore_turf_gravity = FALSE)
. = ..()
if(!isatom(target))
return ELEMENT_INCOMPATIBLE
+8 -2
View File
@@ -1,3 +1,5 @@
GLOBAL_LIST_INIT(freon_color_matrix, list("#2E5E69", "#60A2A8", "#A1AFB1", rgb(0,0,0)))
///simple element to handle frozen obj's
/datum/element/frozen
element_flags = ELEMENT_DETACH
@@ -21,7 +23,7 @@
RegisterSignal(target, COMSIG_MOVABLE_MOVED, .proc/on_moved)
RegisterSignal(target, COMSIG_MOVABLE_POST_THROW, .proc/shatter_on_throw)
RegisterSignal(target, COMSIG_OBJ_UNFREEZE, .proc/on_unfrozen)
RegisterSignal(target, COMSIG_OBJ_UNFREEZE, .proc/on_unfreeze)
/datum/element/frozen/Detach(datum/source, ...)
var/obj/obj_source = source
@@ -31,16 +33,20 @@
obj_source.alpha += 25
. = ..()
/datum/element/frozen/proc/on_unfrozen(datum/source)
///signal handler for COMSIG_OBJ_UNFREEZE that forces us to detach from the target
/datum/element/frozen/proc/on_unfreeze(datum/source)
SIGNAL_HANDLER
Detach(source)
///signal handler for COMSIG_MOVABLE_POST_THROW that shatters our target after impacting after a throw
/datum/element/frozen/proc/shatter_on_throw(datum/target)
SIGNAL_HANDLER
var/obj/obj_target = target
obj_target.visible_message(span_danger("[obj_target] shatters into a million pieces!"))
qdel(obj_target)
/// signal handler for COMSIG_MOVABLE_MOVED that unfreezes our target if it moves onto an open turf thats hotter than
/// our melting temperature.
/datum/element/frozen/proc/on_moved(datum/target)
SIGNAL_HANDLER
var/obj/obj_target = target
+1 -3
View File
@@ -1845,8 +1845,7 @@
if(!gravity_turf)//no gravity in nullspace
return 0
//the list isnt created every time as this proc is very hot, its only accessed if anything is actually listening to the signal too
var/static/list/forced_gravity = list()
var/list/forced_gravity = list()
if(SEND_SIGNAL(src, COMSIG_ATOM_HAS_GRAVITY, gravity_turf, forced_gravity))
if(!length(forced_gravity))
SEND_SIGNAL(gravity_turf, COMSIG_TURF_HAS_GRAVITY, src, forced_gravity)
@@ -1854,7 +1853,6 @@
var/max_grav = 0
for(var/i in forced_gravity)//our gravity is the strongest return forced gravity we get
max_grav = max(max_grav, i)
forced_gravity.Cut()
//cut so we can reuse the list, this is ok since forced gravity movers are exceedingly rare compared to all other movement
return max_grav
+6 -2
View File
@@ -453,7 +453,7 @@
var/atom/old_loc = loc
var/direction = get_dir(old_loc, new_loc)
loc = new_loc
Moved(old_loc, direction)
Moved(old_loc, direction, TRUE, momentum_change = FALSE)
////////////////////////////////////////
// Here's where we rewrite how byond handles movement except slightly different
@@ -595,6 +595,10 @@
if(moving_diagonally == SECOND_DIAG_STEP)
if(!. && set_dir_on_move)
setDir(first_step_dir)
else if(!inertia_moving)
newtonian_move(direct)
if(client_mobs_in_contents)
update_parallax_contents()
moving_diagonally = 0
return
@@ -625,7 +629,7 @@
//glide_size strangely enough can change mid movement animation and update correctly while the animation is playing
//This means that if you don't override it late like this, it will just be set back by the movement update that's called when you move turfs.
if(glide_size_override && glide_size != glide_size_override)
if(glide_size_override)
set_glide_size(glide_size_override)
last_move = direct
+3 -3
View File
@@ -652,9 +652,9 @@
new /obj/item/electronics/firelock (targetloc)
qdel(src)
/obj/machinery/door/firedoor/Moved(atom/oldloc)
/obj/machinery/door/firedoor/Moved(atom/old_loc, movement_dir, forced, list/old_locs, momentum_change = TRUE)
. = ..()
unregister_adjacent_turfs(oldloc)
unregister_adjacent_turfs(old_loc)
register_adjacent_turfs()
/obj/machinery/door/firedoor/closed
@@ -691,7 +691,7 @@
light_xoffset = -2
update_icon()
/obj/machinery/door/firedoor/border_only/Moved()
/obj/machinery/door/firedoor/border_only/Moved(atom/old_loc, movement_dir, forced, list/old_locs, momentum_change = TRUE)
. = ..()
adjust_lights_starting_offset()
+3 -4
View File
@@ -122,15 +122,14 @@ Possible to do for anyone motivated enough:
new_disk.forceMove(src)
disk = new_disk
/obj/machinery/holopad/Moved(atom/OldLoc, Dir)
/obj/machinery/holopad/Moved(atom/old_loc, movement_dir, forced, list/old_locs, momentum_change = TRUE)
. = ..()
if(!loc)
return
// move any relevant holograms, basically non-AI, and rays with the pad
if(replay_holo)
replay_holo.abstract_move(loc)
for(var/i in holorays)
var/obj/effect/overlay/holoray/ray = holorays[i]
for(var/obj/effect/overlay/holoray/ray as anything in holorays)
ray.abstract_move(loc)
var/list/non_call_masters = masters?.Copy()
for(var/datum/holocall/holocall as anything in holo_calls)
@@ -138,7 +137,7 @@ Possible to do for anyone motivated enough:
continue
non_call_masters -= holocall.user
// moving the eye moves the holo which updates the ray too
holocall.eye.setLoc(locate(clamp(x + (holocall.hologram.x - OldLoc.x), 1, world.maxx), clamp(y + (holocall.hologram.y - OldLoc.y), 1, world.maxy), z))
holocall.eye.setLoc(locate(clamp(x + (holocall.hologram.x - old_loc.x), 1, world.maxx), clamp(y + (holocall.hologram.y - old_loc.y), 1, world.maxy), z))
for(var/mob/living/holo_master as anything in non_call_masters)
var/obj/effect/holo = masters[holo_master]
update_holoray(holo_master, holo.loc)
+6 -6
View File
@@ -945,16 +945,16 @@
RegisterSignal(source.loc, COMSIG_ITEM_EQUIPPED, .proc/update_intern_status)
RegisterSignal(source.loc, COMSIG_ITEM_DROPPED, .proc/remove_intern_status)
/obj/item/card/id/advanced/Moved(atom/OldLoc, Dir)
/obj/item/card/id/advanced/Moved(atom/old_loc, movement_dir, forced, list/old_locs, momentum_change = TRUE)
. = ..()
if(istype(OldLoc, /obj/item/storage/wallet))
UnregisterSignal(OldLoc, list(COMSIG_ITEM_EQUIPPED, COMSIG_ITEM_DROPPED))
if(istype(old_loc, /obj/item/storage/wallet))
UnregisterSignal(old_loc, list(COMSIG_ITEM_EQUIPPED, COMSIG_ITEM_DROPPED))
if(istype(OldLoc, /obj/item/computer_hardware/card_slot))
var/obj/item/computer_hardware/card_slot/slot = OldLoc
if(istype(old_loc, /obj/item/computer_hardware/card_slot))
var/obj/item/computer_hardware/card_slot/slot = old_loc
UnregisterSignal(OldLoc, COMSIG_MOVABLE_MOVED)
UnregisterSignal(old_loc, COMSIG_MOVABLE_MOVED)
if(istype(slot.holder, /obj/item/modular_computer/tablet))
var/obj/item/modular_computer/tablet/slot_holder = slot.holder
+1 -1
View File
@@ -355,7 +355,7 @@
return
RegisterSignal(user, COMSIG_MOVABLE_MOVED, .proc/check_range)
/obj/item/shockpaddles/Moved()
/obj/item/shockpaddles/Moved(atom/old_loc, movement_dir, forced, list/old_locs, momentum_change = TRUE)
. = ..()
check_range()
@@ -67,7 +67,7 @@ GLOBAL_LIST_INIT(channel_tokens, list(
else
set_listening(FALSE, actual_setting = FALSE)
/obj/item/radio/headset/Moved(atom/OldLoc, Dir)
/obj/item/radio/headset/Moved(atom/old_loc, movement_dir, forced, list/old_locs, momentum_change = TRUE)
. = ..()
possibly_deactivate_in_loc()
+2 -2
View File
@@ -403,7 +403,7 @@
var/obj/item/toy/plush/narplush/clash_target
gender = MALE //he's a boy, right?
/obj/item/toy/plush/ratplush/Moved()
/obj/item/toy/plush/ratplush/Moved(atom/old_loc, movement_dir, forced, list/old_locs, momentum_change = TRUE)
. = ..()
if(clash_target)
return
@@ -490,7 +490,7 @@
var/clashing
gender = FEMALE //it's canon if the toy is
/obj/item/toy/plush/narplush/Moved()
/obj/item/toy/plush/narplush/Moved(atom/old_loc, movement_dir, forced, list/old_locs, momentum_change = TRUE)
. = ..()
var/obj/item/toy/plush/ratplush/P = locate() in range(1, src)
if(P && istype(P.loc, /turf/open) && !P.clash_target && !clashing)
+2 -2
View File
@@ -91,8 +91,8 @@
if(user.mind.miming)
alpha = 255
/obj/item/storage/box/mime/Moved(oldLoc, dir)
if (iscarbon(oldLoc))
/obj/item/storage/box/mime/Moved(atom/old_loc, movement_dir, forced, list/old_locs, momentum_change = TRUE)
if (iscarbon(old_loc))
alpha = 0
return ..()
+4 -4
View File
@@ -557,20 +557,20 @@
cooling = TRUE
update_appearance()
for(var/C in contents)
freeze(C)
freeze_contents(C)
return
if(cooling && !cool)
cooling = FALSE
update_appearance()
for(var/C in contents)
unfreeze(C)
unfreeze_contents(C)
/obj/item/storage/organbox/update_icon_state()
icon_state = "[base_icon_state][cooling ? "-working" : null]"
return ..()
///freezes the organ and loops bodyparts like heads
/obj/item/storage/organbox/proc/freeze(datum/source, obj/item/I)
/obj/item/storage/organbox/proc/freeze_contents(datum/source, obj/item/I)
SIGNAL_HANDLER
if(isinternalorgan(I))
var/obj/item/organ/internal/int_organ = I
@@ -582,7 +582,7 @@
int_organ.organ_flags |= ORGAN_FROZEN
///unfreezes the organ and loops bodyparts like heads
/obj/item/storage/organbox/proc/unfreeze(datum/source, obj/item/I)
/obj/item/storage/organbox/proc/unfreeze_contents(datum/source, obj/item/I)
SIGNAL_HANDLER
if(isinternalorgan(I))
var/obj/item/organ/internal/int_organ = I
+14
View File
@@ -386,3 +386,17 @@
for(var/reagent in reagents)
var/datum/reagent/R = reagent
. |= R.expose_obj(src, reagents[R])
///attempt to freeze this obj if possible. returns TRUE if it succeeded, FALSE otherwise.
/obj/proc/freeze()
if(HAS_TRAIT(src, TRAIT_FROZEN))
return FALSE
if(obj_flags & FREEZE_PROOF)
return FALSE
AddElement(/datum/element/frozen)
return TRUE
///unfreezes this obj if its frozen
/obj/proc/unfreeze()
SEND_SIGNAL(src, COMSIG_OBJ_UNFREEZE)
@@ -105,7 +105,7 @@
//Push them up from the normal lying position
M.pixel_y = M.base_pixel_y
/obj/structure/bed/roller/Moved()
/obj/structure/bed/roller/Moved(atom/old_loc, movement_dir, forced, list/old_locs, momentum_change = TRUE)
. = ..()
if(has_gravity())
playsound(src, 'sound/effects/roll.ogg', 100, TRUE)
@@ -238,7 +238,7 @@
icon_state = "officechair_dark"
/obj/structure/chair/office/Moved()
/obj/structure/chair/office/Moved(atom/old_loc, movement_dir, forced, list/old_locs, momentum_change = TRUE)
. = ..()
if(has_gravity())
playsound(src, 'sound/effects/roll.ogg', 100, TRUE)
@@ -463,7 +463,7 @@ MAPPING_DIRECTIONAL_HELPERS(/obj/structure/chair/stool/bar, 0)
if(turns >= 8)
STOP_PROCESSING(SSfastprocess, src)
/obj/structure/chair/bronze/Moved()
/obj/structure/chair/bronze/Moved(atom/old_loc, movement_dir, forced, list/old_locs, momentum_change = TRUE)
. = ..()
if(has_gravity())
playsound(src, 'sound/machines/clockcult/integration_cog_install.ogg', 50, TRUE)
@@ -146,7 +146,7 @@
icon_state = "trashcart"
can_install_electronics = FALSE
/obj/structure/closet/crate/trashcart/Moved()
/obj/structure/closet/crate/trashcart/Moved(atom/old_loc, movement_dir, forced, list/old_locs, momentum_change = TRUE)
. = ..()
if(has_gravity())
playsound(src, 'sound/effects/roll.ogg', 100, TRUE)
+5 -6
View File
@@ -356,16 +356,15 @@
attached_items -= source
UnregisterSignal(source, COMSIG_MOVABLE_MOVED)
/obj/structure/table/rolling/Moved(atom/OldLoc, Dir)
/obj/structure/table/rolling/Moved(atom/old_loc, movement_dir, forced, list/old_locs, momentum_change = TRUE)
. = ..()
if(!loc)
return
for(var/mob/living/living_mob in OldLoc.contents)//Kidnap everyone on top
for(var/mob/living/living_mob in old_loc.contents)//Kidnap everyone on top
living_mob.forceMove(loc)
for(var/x in attached_items)
var/atom/movable/AM = x
if(!AM.Move(loc))
RemoveItemFromTable(AM, AM.loc)
for(var/atom/movable/attached_movable as anything in attached_items)
if(!attached_movable.Move(loc))
RemoveItemFromTable(attached_movable, attached_movable.loc)
/*
* Glass tables
+3 -1
View File
@@ -368,10 +368,12 @@ GLOBAL_LIST_EMPTY(station_turfs)
if(thing == mover || thing == mover.loc) // Multi tile objects and moving out of other objects
continue
if(!thing.Cross(mover))
if(QDELETED(mover)) //Mover deleted from Cross/CanPass, do not proceed.
if(QDELETED(mover)) //deleted from Cross() (CanPass is pure so it cant delete, Cross shouldnt be doing this either though, but it can happen)
return FALSE
if((mover.movement_type & PHASING))
mover.Bump(thing)
if(QDELETED(mover)) //deleted from Bump()
return FALSE
continue
else
if(!firstbump || ((thing.layer > firstbump.layer || thing.flags_1 & ON_BORDER_1) && !(firstbump.flags_1 & ON_BORDER_1)))
@@ -88,22 +88,21 @@
range = 15
speed = 1
/obj/projectile/magic/aoe/rust_wave/Moved(atom/OldLoc, Dir)
/obj/projectile/magic/aoe/rust_wave/Moved(atom/old_loc, movement_dir, forced, list/old_locs, momentum_change = TRUE)
. = ..()
playsound(src, 'sound/items/welder.ogg', 75, TRUE)
var/list/turflist = list()
var/turf/T1
turflist += get_turf(src)
T1 = get_step(src,turn(dir,90))
T1 = get_step(src,turn(movement_dir,90))
turflist += T1
turflist += get_step(T1,turn(dir,90))
T1 = get_step(src,turn(dir,-90))
turflist += get_step(T1,turn(movement_dir,90))
T1 = get_step(src,turn(movement_dir,-90))
turflist += T1
turflist += get_step(T1,turn(dir,-90))
for(var/X in turflist)
if(!X || prob(25))
turflist += get_step(T1,turn(movement_dir,-90))
for(var/turf/T as anything in turflist)
if(!T || prob(25))
continue
var/turf/T = X
T.rust_heretic_act()
/datum/action/cooldown/spell/basic_projectile/rust_wave/short
@@ -367,7 +367,7 @@
setDir(SOUTH) // reset dir so the right directional sprites show up
return ..()
/mob/living/simple_animal/revenant/Moved(atom/OldLoc)
/mob/living/simple_animal/revenant/Moved(atom/old_loc, movement_dir, forced, list/old_locs, momentum_change = TRUE)
if(!orbiting) // only needed when orbiting
return ..()
if(incorporeal_move_check(src))
@@ -375,7 +375,7 @@
// back back back it up, the orbitee went somewhere revenant cannot
orbiting?.end_orbit(src)
abstract_move(OldLoc) // gross but maybe orbit component will be able to check pre move in the future
abstract_move(old_loc) // gross but maybe orbit component will be able to check pre move in the future
/mob/living/simple_animal/revenant/stop_orbit(datum/component/orbiter/orbits)
// reset the simple_flying animation
@@ -181,7 +181,7 @@
planted_on.vis_contents -= src
return ..()
/obj/item/traitor_bug/Moved(atom/OldLoc, Dir)
/obj/item/traitor_bug/Moved(atom/old_loc, movement_dir, forced, list/old_locs, momentum_change = TRUE)
. = ..()
if(planted_on)
planted_on.vis_contents -= src
+1 -1
View File
@@ -128,7 +128,7 @@
. = ..()
refreshBeam()
/obj/item/assembly/infra/Moved()
/obj/item/assembly/infra/Moved(atom/old_loc, movement_dir, forced, list/old_locs, momentum_change = TRUE)
var/t = dir
. = ..()
setDir(t)
+1 -1
View File
@@ -446,7 +446,7 @@
rubble.setStyle(rubble_type, src)
update_appearance()
/obj/structure/closet/supplypod/Moved()
/obj/structure/closet/supplypod/Moved(atom/old_loc, movement_dir, forced, list/old_locs, momentum_change = TRUE)
deleteRubble()
return ..()
+1 -1
View File
@@ -129,7 +129,7 @@ In my current plan for it, 'solid' will be defined as anything with density == 1
if(destination.density && isturf(destination))
Bump(destination)
/obj/effect/immovablerod/Moved()
/obj/effect/immovablerod/Moved(atom/old_loc, movement_dir, forced, list/old_locs, momentum_change = TRUE)
if(!loc)
return ..()
+1 -1
View File
@@ -128,7 +128,7 @@
var/weight_mod = modifier * average_weight
weight = max(1,gaussian(average_weight + weight_mod, weight_deviation))
/obj/item/fish/Moved(atom/OldLoc, Dir)
/obj/item/fish/Moved(atom/old_loc, movement_dir, forced, list/old_locs, momentum_change = TRUE)
. = ..()
check_environment_after_movement()
+1 -1
View File
@@ -149,7 +149,7 @@ GLOBAL_LIST_INIT(hallucination_list, list(
. = ..()
Show()
/obj/effect/hallucination/simple/Moved(atom/OldLoc, Dir)
/obj/effect/hallucination/simple/Moved(atom/old_loc, movement_dir, forced, list/old_locs, momentum_change = TRUE)
. = ..()
if(!loc)
return
+6 -6
View File
@@ -40,10 +40,10 @@
/datum/light_source/New(atom/owner, atom/top)
source_atom = owner // Set our new owner.
add_to_light_sources(source_atom.light_sources)
add_to_light_sources(source_atom)
top_atom = top
if (top_atom != source_atom)
add_to_light_sources(top_atom.light_sources)
add_to_light_sources(top_atom)
source_turf = top_atom
pixel_turf = get_turf_pixel(top_atom) || source_turf
@@ -59,10 +59,10 @@
/datum/light_source/Destroy(force)
remove_lum()
if (source_atom)
remove_from_light_sources(source_atom.light_sources)
remove_from_light_sources(source_atom)
if (top_atom)
remove_from_light_sources(top_atom.light_sources)
remove_from_light_sources(top_atom)
if (needs_update)
SSlighting.sources_queue -= src
@@ -118,12 +118,12 @@
// This top atom is different.
if (new_top_atom && new_top_atom != top_atom)
if(top_atom != source_atom && top_atom.light_sources) // Remove ourselves from the light sources of that top atom.
remove_from_light_sources(top_atom.light_sources)
remove_from_light_sources(top_atom)
top_atom = new_top_atom
if (top_atom != source_atom)
add_to_light_sources(top_atom.light_sources)
add_to_light_sources(top_atom)
EFFECT_UPDATE(LIGHTING_CHECK_UPDATE)
@@ -29,21 +29,19 @@
var/caught = hit_atom.hitby(src, FALSE, FALSE, throwingdatum=throwingdatum)
var/mob/thrown_by = thrownby?.resolve()
if(ismovable(hit_atom) && !caught && (!thrown_by || thrown_by && COOLDOWN_FINISHED(src, freeze_cooldown)))
freeze(hit_atom)
freeze_hit_atom(hit_atom)
if(thrown_by && !caught)
addtimer(CALLBACK(src, /atom/movable.proc/throw_at, thrown_by, throw_range+2, throw_speed, null, TRUE), 1)
/obj/item/freeze_cube/proc/freeze(atom/movable/hit_atom)
/obj/item/freeze_cube/proc/freeze_hit_atom(atom/movable/hit_atom)
playsound(src, 'sound/effects/glassbr3.ogg', 50, TRUE)
COOLDOWN_START(src, freeze_cooldown, cooldown_time)
if(isobj(hit_atom))
var/obj/hit_object = hit_atom
if(hit_object.resistance_flags & FREEZE_PROOF)
var/success = hit_object.freeze()
if(!success && hit_object.resistance_flags & FREEZE_PROOF)
hit_object.visible_message(span_warning("[hit_object] is freeze-proof!"))
return
if(HAS_TRAIT(hit_object, TRAIT_FROZEN))
return
hit_object.AddElement(/datum/element/frozen)
else if(isliving(hit_atom))
var/mob/living/hit_mob = hit_atom
SSmove_manager.stop_looping(hit_mob) //stops them mid pathing even if they're stunimmune
@@ -240,7 +240,7 @@
animate(src, pixel_x=rand(-5,5), pixel_y=rand(-2,2), time=1)
QDEL_IN(src,COLLAPSE_DURATION)
/obj/structure/puzzle_element/Moved()
/obj/structure/puzzle_element/Moved(atom/old_loc, movement_dir, forced, list/old_locs, momentum_change = TRUE)
. = ..()
if(source)
source.validate()
+2 -2
View File
@@ -127,12 +127,12 @@ GLOBAL_LIST_INIT(meteorsC, list(/obj/effect/meteor/dust=1)) //for space dust eve
GLOB.meteor_list -= src
return ..()
/obj/effect/meteor/Moved(atom/OldLoc, Dir, Forced = FALSE)
/obj/effect/meteor/Moved(atom/old_loc, movement_dir, forced, list/old_locs, momentum_change = TRUE)
. = ..()
if(QDELETED(src))
return
if(OldLoc != loc)//If did move, ram the turf we get in
if(old_loc != loc)//If did move, ram the turf we get in
var/turf/T = get_turf(loc)
ram_turf(T)
+1 -1
View File
@@ -31,7 +31,7 @@
if(input_turf)
UnregisterSignal(input_turf, list(COMSIG_ATOM_ENTERED, COMSIG_ATOM_INITIALIZED_ON))
/obj/machinery/mineral/Moved()
/obj/machinery/mineral/Moved(atom/old_loc, movement_dir, forced, list/old_locs, momentum_change = TRUE)
. = ..()
if(!needs_item_input || !anchored)
return
+1 -1
View File
@@ -1,4 +1,4 @@
/mob/living/Moved()
/mob/living/Moved(atom/old_loc, movement_dir, forced, list/old_locs, momentum_change = TRUE)
. = ..()
update_turf_movespeed(loc)
@@ -1,6 +1,6 @@
/mob/living/silicon/Moved(oldLoc, dir)
/mob/living/silicon/Moved(atom/old_loc, movement_dir, forced, list/old_locs, momentum_change = TRUE)
. = ..()
update_camera_location(oldLoc)
update_camera_location(old_loc)
/mob/living/silicon/forceMove(atom/destination)
. = ..()
@@ -478,7 +478,7 @@
pathset = TRUE //Indicates the AI's custom path is initialized.
start()
/mob/living/simple_animal/bot/mulebot/Moved()
/mob/living/simple_animal/bot/mulebot/Moved(atom/old_loc, movement_dir, forced, list/old_locs, momentum_change = TRUE)
. = ..()
if(has_gravity())
for(var/mob/living/carbon/human/future_pancake in loc)
@@ -48,7 +48,7 @@
summoner.AddElement(/datum/element/forced_gravity, 1)
AddElement(/datum/element/forced_gravity, 1)
/mob/living/simple_animal/hostile/guardian/gravitokinetic/Moved(oldLoc, dir)
/mob/living/simple_animal/hostile/guardian/gravitokinetic/Moved(atom/old_loc, movement_dir, forced, list/old_locs, momentum_change = TRUE)
. = ..()
for(var/i in gravito_targets)
if(get_dist(src, i) > gravity_power_range)
@@ -102,7 +102,7 @@
SpinAnimation(5, 1)
last_target = WEAKREF(attacked_target)
/mob/living/simple_animal/hostile/heretic_summon/raw_prophet/Moved(atom/old_loc, movement_dir, forced = FALSE, list/old_locs)
/mob/living/simple_animal/hostile/heretic_summon/raw_prophet/Moved(atom/old_loc, movement_dir, forced, list/old_locs, momentum_change = TRUE)
. = ..()
var/rotation_degree = (360 / 3)
if(movement_dir & WEST || movement_dir & SOUTH)
@@ -370,7 +370,7 @@
icon_state = "rust_walker_s"
update_appearance(UPDATE_ICON_STATE)
/mob/living/simple_animal/hostile/heretic_summon/rust_spirit/Moved()
/mob/living/simple_animal/hostile/heretic_summon/rust_spirit/Moved(atom/old_loc, movement_dir, forced, list/old_locs, momentum_change = TRUE)
. = ..()
playsound(src, 'sound/effects/footstep/rustystep1.ogg', 100, TRUE)
@@ -218,7 +218,7 @@
return
charge.Trigger(target = target)
/mob/living/simple_animal/hostile/giant_spider/tarantula/Moved(atom/oldloc, dir)
/mob/living/simple_animal/hostile/giant_spider/tarantula/Moved(atom/old_loc, movement_dir, forced, list/old_locs, momentum_change = TRUE)
. = ..()
var/obj/structure/spider/stickyweb/web = locate() in loc
if(web && !silk_walking)
@@ -70,7 +70,7 @@
var/datum/action/small_sprite/small_action = new small_sprite_type()
small_action.Grant(src)
/mob/living/simple_animal/hostile/megafauna/Moved()
/mob/living/simple_animal/hostile/megafauna/Moved(atom/old_loc, movement_dir, forced, list/old_locs, momentum_change = TRUE)
//Safety check
if(!loc)
return ..()
@@ -483,10 +483,10 @@ Difficulty: Hard
if(!blinking)
. = ..()
/mob/living/simple_animal/hostile/megafauna/hierophant/Moved(oldLoc, movement_dir)
/mob/living/simple_animal/hostile/megafauna/hierophant/Moved(atom/old_loc, movement_dir, forced, list/old_locs, momentum_change = TRUE)
. = ..()
if(!stat && .)
var/obj/effect/temp_visual/hierophant/squares/HS = new(oldLoc)
var/obj/effect/temp_visual/hierophant/squares/HS = new(old_loc)
HS.setDir(movement_dir)
playsound(src, 'sound/mecha/mechmove04.ogg', 150, TRUE, -4)
if(target)
@@ -137,9 +137,9 @@ Difficulty: Hard
stored_move_dirs |= direct
return ..()
/mob/living/simple_animal/hostile/megafauna/wendigo/Moved(atom/oldloc, direct)
/mob/living/simple_animal/hostile/megafauna/wendigo/Moved(atom/old_loc, movement_dir, forced, list/old_locs, momentum_change = TRUE)
. = ..()
stored_move_dirs &= ~direct
stored_move_dirs &= ~movement_dir
if(!stored_move_dirs)
INVOKE_ASYNC(GLOBAL_PROC, .proc/wendigo_slam, src, stomp_range, 1, 8)
@@ -99,7 +99,7 @@
addtimer(CALLBACK(src, .proc/fire_laser), 1 SECONDS)
COOLDOWN_START(src, ranged_cooldown, ranged_cooldown_time)
/mob/living/simple_animal/hostile/asteroid/brimdemon/Moved()
/mob/living/simple_animal/hostile/asteroid/brimdemon/Moved(atom/old_loc, movement_dir, forced, list/old_locs, momentum_change = TRUE)
. = ..()
check_fire()
@@ -157,7 +157,7 @@
. = ..()
pull_vines()
/mob/living/simple_animal/hostile/venus_human_trap/Moved(atom/OldLoc, Dir)
/mob/living/simple_animal/hostile/venus_human_trap/Moved(atom/old_loc, movement_dir, forced, list/old_locs, momentum_change = TRUE)
. = ..()
pixel_x = base_pixel_x + (dir & (NORTH|WEST) ? 2 : -2)
@@ -816,7 +816,7 @@ GLOBAL_LIST_INIT(strippable_parrot_items, create_strippable_list(list(
to_chat(src, span_warning("There is no perch nearby to sit on!"))
return
/mob/living/simple_animal/parrot/Moved(oldLoc, dir)
/mob/living/simple_animal/parrot/Moved(atom/old_loc, movement_dir, forced, list/old_locs, momentum_change = TRUE)
. = ..()
if(. && !stat && client && parrot_state == PARROT_PERCH)
parrot_state = PARROT_WANDER
+2 -4
View File
@@ -119,8 +119,7 @@
//We are now going to move
var/add_delay = mob.cached_multiplicative_slowdown
var/new_glide_size = DELAY_TO_GLIDE_SIZE(add_delay * ( (NSCOMPONENT(direct) && EWCOMPONENT(direct)) ? SQRT_2 : 1 ) )
if(mob.glide_size != new_glide_size)
mob.set_glide_size(new_glide_size) // set it now in case of pulled objects
mob.set_glide_size(new_glide_size) // set it now in case of pulled objects
//If the move was recent, count using old_move_delay
//We want fractional behavior and all
if(old_move_delay + world.tick_lag > world.time)
@@ -145,8 +144,7 @@
else
after_glide = DELAY_TO_GLIDE_SIZE(add_delay)
if(after_glide != mob.glide_size)
mob.set_glide_size(after_glide)
mob.set_glide_size(after_glide)
move_delay += add_delay
if(.) // If mob is null here, we deserve the runtime
+1 -1
View File
@@ -254,7 +254,7 @@
if(slot == slot_flags)
return TRUE
/obj/item/mod/control/Moved(atom/old_loc, movement_dir, forced = FALSE, list/old_locs)
/obj/item/mod/control/Moved(atom/old_loc, movement_dir, forced, list/old_locs, momentum_change = TRUE)
. = ..()
if(!wearer || old_loc != wearer || loc == wearer)
return
+1 -1
View File
@@ -123,7 +123,7 @@
if(!is_mining_level(z))
power_gen = 0
/obj/machinery/power/rtg/lavaland/Moved(atom/OldLoc, Dir)
/obj/machinery/power/rtg/lavaland/Moved(atom/old_loc, movement_dir, forced, list/old_locs, momentum_change = TRUE)
. = ..()
var/turf/our_turf = get_turf(src)
if(!islava(our_turf))
+1 -1
View File
@@ -141,7 +141,7 @@
/obj/machinery/power/turbine/proc/disable_parts(mob/user)
can_connect = FALSE
/obj/machinery/power/turbine/Moved(atom/OldLoc, Dir)
/obj/machinery/power/turbine/Moved(atom/old_loc, movement_dir, forced, list/old_locs, momentum_change = TRUE)
. = ..()
disable_parts()
air_update_turf(TRUE)
+1 -1
View File
@@ -590,7 +590,7 @@
* Scan turf we're now in for anything we can/should hit. This is useful for hitting non dense objects the user
* directly clicks on, as well as for PHASING projectiles to be able to hit things at all as they don't ever Bump().
*/
/obj/projectile/Moved(atom/OldLoc, Dir)
/obj/projectile/Moved(atom/old_loc, movement_dir, forced, list/old_locs, momentum_change = TRUE)
. = ..()
if(!fired)
return
+1 -1
View File
@@ -466,7 +466,7 @@
return FALSE
return ..()
/obj/projectile/magic/aoe/Moved(atom/OldLoc, Dir)
/obj/projectile/magic/aoe/Moved(atom/old_loc, movement_dir, forced, list/old_locs, momentum_change = TRUE)
. = ..()
if(trail)
create_trail()
+1 -1
View File
@@ -97,7 +97,7 @@
tank_leak()
return TOOL_ACT_TOOLTYPE_SUCCESS
/obj/structure/reagent_dispensers/Moved(atom/OldLoc, Dir)
/obj/structure/reagent_dispensers/Moved(atom/old_loc, movement_dir, forced, list/old_locs, momentum_change = TRUE)
. = ..()
tank_leak()
+1 -1
View File
@@ -113,7 +113,7 @@ GLOBAL_LIST_EMPTY(conveyors_by_id)
. = ..()
update_move_direction()
/obj/machinery/conveyor/Moved(atom/OldLoc, Dir)
/obj/machinery/conveyor/Moved(atom/old_loc, movement_dir, forced, list/old_locs, momentum_change = TRUE)
. = ..()
if(!.)
return
+1 -1
View File
@@ -92,7 +92,7 @@
active = FALSE
//failsafe in the case the holder is somehow forcemoved somewhere that's not a disposal pipe. Otherwise the above loop breaks.
/obj/structure/disposalholder/Moved(atom/oldLoc, dir)
/obj/structure/disposalholder/Moved(atom/old_loc, movement_dir, forced, list/old_locs, momentum_change = TRUE)
. = ..()
var/static/list/pipes_typecache = typecacheof(/obj/structure/disposalpipe)
//Moved to nullspace gang
+1 -1
View File
@@ -246,7 +246,7 @@
unregister()
. = ..()
/obj/docking_port/stationary/Moved(atom/oldloc, dir, forced)
/obj/docking_port/stationary/Moved(atom/old_loc, movement_dir, forced, list/old_locs, momentum_change = TRUE)
. = ..()
if(area_type) // We already have one
return
@@ -181,7 +181,7 @@
shape = null
return ..()
/obj/shapeshift_holder/Moved()
/obj/shapeshift_holder/Moved(atom/old_loc, movement_dir, forced, list/old_locs, momentum_change = TRUE)
. = ..()
if(!restoring && !QDELETED(src))
restore()
+1 -1
View File
@@ -38,7 +38,7 @@
turret = new(loc)
turret.base = src
/obj/vehicle/ridden/atv/turret/Moved()
/obj/vehicle/ridden/atv/turret/Moved(atom/old_loc, movement_dir, forced, list/old_locs, momentum_change = TRUE)
. = ..()
if(!turret)
return
+1 -1
View File
@@ -26,7 +26,7 @@
qdel(src)
return TRUE
/obj/vehicle/ridden/scooter/Moved()
/obj/vehicle/ridden/scooter/Moved(atom/old_loc, movement_dir, forced, list/old_locs, momentum_change = TRUE)
. = ..()
for(var/mob/living/buckled_mob as anything in buckled_mobs)
if(buckled_mob.num_legs > 0)
+1 -1
View File
@@ -60,7 +60,7 @@
visible_message(span_danger("[src] crashes into [rammed]!"))
playsound(src, 'sound/effects/bang.ogg', 50, TRUE)
/obj/vehicle/ridden/speedwagon/Moved()
/obj/vehicle/ridden/speedwagon/Moved(atom/old_loc, movement_dir, forced, list/old_locs, momentum_change = TRUE)
. = ..()
if(!has_buckled_mobs())
return
+1 -1
View File
@@ -35,7 +35,7 @@
new /obj/item/stack/sheet/iron(drop_location(), 1)
return ..()
/obj/vehicle/ridden/wheelchair/Moved()
/obj/vehicle/ridden/wheelchair/Moved(atom/old_loc, movement_dir, forced, list/old_locs, momentum_change = TRUE)
. = ..()
playsound(src, 'sound/effects/roll.ogg', 75, TRUE)