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
@@ -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()