Skip to content

Commit

Permalink
Fixes tableflips flipping ghosts (ParadiseSS13#26288)
Browse files Browse the repository at this point in the history
  • Loading branch information
DGamerL authored Jul 28, 2024
1 parent 7b86295 commit c634c9a
Showing 1 changed file with 11 additions and 9 deletions.
20 changes: 11 additions & 9 deletions code/game/objects/structures/tables_racks.dm
Original file line number Diff line number Diff line change
Expand Up @@ -343,34 +343,36 @@

/obj/structure/table/proc/flip(direction)
if(flipped)
return 0
return FALSE

if(!straight_table_check(turn(direction,90)) || !straight_table_check(turn(direction,-90)))
return 0
if(!straight_table_check(turn(direction, 90)) || !straight_table_check(turn(direction, -90)))
return FALSE

dir = direction
if(dir != NORTH)
layer = 5
var/list/targets = list(get_step(src,dir),get_step(src,turn(dir, 45)),get_step(src,turn(dir, -45)))

var/list/targets = list(get_step(src, dir), get_step(src, turn(dir, 45)), get_step(src, turn(dir, -45)))
for(var/atom/movable/A in get_turf(src))
if(isobserver(A))
continue
if(!A.anchored)
spawn(0)
A.throw_at(pick(targets),1,1)
INVOKE_ASYNC(A, TYPE_PROC_REF(/atom/movable/, throw_at), pick(targets), 1, 1)

flipped = TRUE
smoothing_flags = NONE
flags |= ON_BORDER
for(var/D in list(turn(direction, 90), turn(direction, -90)))
if(locate(/obj/structure/table,get_step(src,D)))
var/obj/structure/table/T = locate(/obj/structure/table,get_step(src,D))
if(locate(/obj/structure/table, get_step(src, D)))
var/obj/structure/table/T = locate(/obj/structure/table, get_step(src, D))
T.flip(direction)
update_icon()

creates_cover = FALSE
if(isturf(loc))
REMOVE_TRAIT(loc, TRAIT_TURF_COVERED, UNIQUE_TRAIT_SOURCE(src))

return 1
return TRUE

/obj/structure/table/proc/unflip()
if(!flipped)
Expand Down

0 comments on commit c634c9a

Please sign in to comment.