[MIRROR] Fix Tram ghost magnet and other cases of observer forceMove (#6804)

* Fix Tram ghost magnet and other cases of observer forceMove (#60026)

* Fix Tram ghost magnet and other cases of observer forceMove

Co-authored-by: Wayland-Smithy <64715958+Wayland-Smithy@users.noreply.github.com>
This commit is contained in:
SkyratBot
2021-07-10 14:16:55 +01:00
committed by GitHub
co-authored by Wayland-Smithy
parent 2376021ddb
commit c9eefd511b
5 changed files with 28 additions and 19 deletions
+5 -5
View File
@@ -656,18 +656,18 @@ so as to remain in compliance with the most up-to-date laws."
return
if(!target)
return
var/mob/dead/observer/dead_owner = owner
if(!istype(dead_owner))
var/mob/dead/observer/ghost_owner = owner
if(!istype(ghost_owner))
return
switch(action)
if(NOTIFY_ATTACK)
target.attack_ghost(dead_owner)
target.attack_ghost(ghost_owner)
if(NOTIFY_JUMP)
var/turf/target_turf = get_turf(target)
if(target_turf && isturf(target_turf))
dead_owner.forceMove(target_turf)
ghost_owner.abstract_move(target_turf)
if(NOTIFY_ORBIT)
dead_owner.ManualFollow(target)
ghost_owner.ManualFollow(target)
//OBJECT-BASED
+2 -2
View File
@@ -13,7 +13,7 @@
// Otherwise jump
else if(A.loc)
forceMove(get_turf(A))
abstract_move(get_turf(A))
update_parallax_contents()
/mob/dead/observer/ClickOn(atom/A, params)
@@ -77,5 +77,5 @@
/obj/machinery/teleport/hub/attack_ghost(mob/user)
if(power_station?.engaged && power_station.teleporter_console && power_station.teleporter_console.target)
user.forceMove(get_turf(power_station.teleporter_console.target))
user.abstract_move(get_turf(power_station.teleporter_console.target))
return ..()
+4 -5
View File
@@ -98,7 +98,7 @@
var/atom/movable/movable_parent = parent
orbiter.glide_size = movable_parent.glide_size
orbiter.forceMove(get_turf(parent))
orbiter.abstract_move(get_turf(parent))
to_chat(orbiter, span_notice("Now orbiting [parent]."))
/datum/component/orbiter/proc/end_orbit(atom/movable/orbiter, refreshing=FALSE)
@@ -133,11 +133,10 @@
qdel(src)
var/atom/curloc = master.loc
for(var/i in orbiter_list)
var/atom/movable/thing = i
if(QDELETED(thing) || thing.loc == newturf)
for(var/atom/movable/movable_orbiter as anything in orbiter_list)
if(QDELETED(movable_orbiter) || movable_orbiter.loc == newturf)
continue
thing.forceMove(newturf)
movable_orbiter.abstract_move(newturf)
if(CHECK_TICK && master.loc != curloc)
// We moved again during the checktick, cancel current operation
break
+13 -7
View File
@@ -72,9 +72,13 @@
if(SEND_SIGNAL(destturf, COMSIG_ATOM_INTERCEPT_TELEPORT, channel, curturf, destturf))
return FALSE
if(isobserver(teleatom))
teleatom.abstract_move(destturf)
return TRUE
tele_play_specials(teleatom, curturf, effectin, asoundin)
var/success = teleatom.forceMove(destturf)
if (success)
if(success)
log_game("[key_name(teleatom)] has teleported from [loc_name(curturf)] to [loc_name(destturf)]")
tele_play_specials(teleatom, destturf, effectout, asoundout)
@@ -85,12 +89,14 @@
return TRUE
/proc/tele_play_specials(atom/movable/teleatom, atom/location, datum/effect_system/effect, sound)
if (location && !isobserver(teleatom))
if (sound)
playsound(location, sound, 60, TRUE)
if (effect)
effect.attach(location)
effect.start()
if(!location)
return
if(sound)
playsound(location, sound, 60, TRUE)
if(effect)
effect.attach(location)
effect.start()
// Safe location finder
/proc/find_safe_turf(zlevel, list/zlevels, extended_safety_checks = FALSE, dense_atoms = TRUE)
@@ -354,6 +354,10 @@ This is the proc mobs get to turn into a ghost. Forked from ghostize due to comp
Moved(oldloc, direct)
/mob/dead/observer/forceMove(atom/destination)
abstract_move(destination) // move like the wind
return TRUE
/mob/dead/observer/verb/reenter_corpse()
set category = "Ghost"
set name = "Re-enter Corpse"