Skip to content

Commit

Permalink
fixes memorial ghosts not facing the right direction
Browse files Browse the repository at this point in the history
  • Loading branch information
VileBeggar committed Nov 5, 2024
1 parent 65267a1 commit 3f1e5fa
Showing 1 changed file with 9 additions and 12 deletions.
21 changes: 9 additions & 12 deletions code/modules/almayer/ship_memorial.dm
Original file line number Diff line number Diff line change
Expand Up @@ -235,8 +235,6 @@
if(!person)
return

var/obj/effect/client_image_holder/memorial_ghost/ghost = new(user, user, person)

///All acceptable turfs where the ghost could spawn.
var/list/ghost_turf = list()
for(var/turf/turf in range(user.loc, range))
Expand All @@ -248,7 +246,7 @@
continue

for(var/obj/object in turf)
if(object.density || (object != ghost && istype(object, /obj/effect/client_image_holder/memorial_ghost)))
if(object.density || istype(object, /obj/effect/client_image_holder/memorial_ghost))
bad_turf = TRUE
break

Expand All @@ -262,11 +260,11 @@
ghost_turf += turf

if(!length(ghost_turf))
qdel(ghost)
return

ghost.loc = pick(ghost_turf)
ghost.dir = get_dir(ghost.loc, user.loc)
var/turf/spawn_loc = pick(ghost_turf)
var/dir_to_face = get_dir(spawn_loc, user.loc)
var/obj/effect/client_image_holder/memorial_ghost/ghost = new(spawn_loc, user, person, dir_to_face)

return ghost

Expand Down Expand Up @@ -360,28 +358,27 @@
#undef REQUIRED_DEAD_SQUADDIES

/obj/effect/client_image_holder/memorial_ghost
desc = "May we never forget freedom isn't free."
var/mob/living/mob_reference

/obj/effect/client_image_holder/memorial_ghost/proc/disappear()
var/time_to_disappear = rand(0.4 SECONDS, 0.8 SECONDS)
animate(shown_image, alpha = 0, QUAD_EASING, time = time_to_disappear)
QDEL_IN(src, time_to_disappear)

/obj/effect/client_image_holder/memorial_ghost/Initialize(mapload, list/mobs_which_see_us, mob/living/reference = null)
/obj/effect/client_image_holder/memorial_ghost/Initialize(mapload, list/mobs_which_see_us, mob/living/reference = null, direction_to_face)
mob_reference = reference
if(!mob_reference)
return INITIALIZE_HINT_QDEL

. = ..()
dir = direction_to_face
name = mob_reference.name
desc = "May we never forget freedom isn't free."
return ..()

/obj/effect/client_image_holder/memorial_ghost/generate_image()
var/image/created = image(null, src, null, image_layer, dir = src.dir)
var/image/created = image(null, src, null, image_layer, src.dir, image_pixel_x, image_pixel_y)
created.appearance = mob_reference.appearance
created.transform = matrix(mob_reference.base_transform)
created.pixel_x = image_pixel_x
created.pixel_y = image_pixel_y
created.alpha = 0
if(image_color)
created.color = image_color
Expand Down

0 comments on commit 3f1e5fa

Please sign in to comment.