Files
Bubberstation/code/datums/elements/inverted_movement.dm
Ghom 9cc18fe1fe [NO GBP] The deathmatch modifiers modal menu can actually be opened now. (#82041)
## About The Pull Request
I've fucked up the logic, so it requires the user to be both the host
and an admin to open it, which was the case when I tested it locally.
This PR fixes that and other issues (and **un**dumbs some of the code).
The spinning screen modifier has also been scrapped for being downright
awful and breaking my screen.

## Why It's Good For The Game
Fixing stuff I've thankfully noticed early.

## Changelog

🆑
fix: The deathmatch modifiers modal menu can actually be opened now.
Also fixed a bunch of issues it had.
/🆑
2024-03-18 21:10:57 +01:00

18 lines
618 B
Plaintext

/datum/element/inverted_movement
/datum/element/inverted_movement/Attach(datum/target)
. = ..()
if(!isliving(target))
return ELEMENT_INCOMPATIBLE
RegisterSignal(target, COMSIG_MOB_CLIENT_PRE_MOVE, PROC_REF(invert_movement))
/datum/element/inverted_movement/Detach(datum/source)
UnregisterSignal(source, COMSIG_MOB_CLIENT_PRE_MOVE)
return ..()
/datum/element/inverted_movement/proc/invert_movement(mob/living/source, move_args)
SIGNAL_HANDLER
var/new_direct = REVERSE_DIR(move_args[MOVE_ARG_DIRECTION])
move_args[MOVE_ARG_DIRECTION] = new_direct
move_args[MOVE_ARG_NEW_LOC] = get_step(source, new_direct)