Replaces move_on_shuttle with a trait (#83550)

## About The Pull Request

`move_on_shuttle` was a variable that existed on `/mob` despite only
ever being used by cameras. This PR downgrades the variable to only
exist on `/mob/camera` types, but have the only thing that variable do
is add a trait that blocks movement on shuttles if not allowed. This
allows us to check the variable without casting to camera, which is what
some code was un-necessarily doing. This also retainst the ability to
add the trait later on to different mobs who we may not want to be on
shuttles that aren't `/mob/camera`.
## Why It's Good For The Game

There's no point for this variable to live on `/mob` if all it can do is
clog up the VV screen, especially if the current utilization for it is
only cameras. Let's move it off `/mob` and turn it into a trait so it
still has the similar utilization on a global level without typecasting
- as well as make it actually work since needless typecasting was
introducing a minor bug
## Changelog
Irrelevant.

---------

Co-authored-by: Time-Green <7501474+Time-Green@users.noreply.github.com>
This commit is contained in:
san7890
2024-05-30 00:54:31 -06:00
committed by GitHub
parent 15a657bcbc
commit e81f9c6ef0
9 changed files with 16 additions and 18 deletions
+3 -8
View File
@@ -112,14 +112,9 @@
return FALSE
/obj/docking_port/mobile/arrivals/proc/PersonCheck()
for(var/V in GLOB.player_list)
var/mob/M = V
if((get_area(M) in areas) && M.stat != DEAD)
if(!iscameramob(M))
return TRUE
var/mob/camera/C = M
if(C.move_on_shuttle)
return TRUE
for(var/mob/player as anything in GLOB.player_list)
if((get_area(player) in areas) && (player.stat != DEAD) && !HAS_TRAIT(player, TRAIT_BLOCK_SHUTTLE_MOVEMENT))
return TRUE
return FALSE
/obj/docking_port/mobile/arrivals/proc/NukeDiskCheck()
+2 -2
View File
@@ -264,12 +264,12 @@ All ShuttleMove procs go here
/************************************Mob move procs************************************/
/mob/onShuttleMove(turf/newT, turf/oldT, list/movement_force, move_dir, obj/docking_port/stationary/old_dock, obj/docking_port/mobile/moving_dock)
if(!move_on_shuttle)
if(HAS_TRAIT(src, TRAIT_BLOCK_SHUTTLE_MOVEMENT))
return
. = ..()
/mob/afterShuttleMove(turf/oldT, list/movement_force, shuttle_dir, shuttle_preferred_direction, move_dir, rotation)
if(!move_on_shuttle)
if(HAS_TRAIT(src, TRAIT_BLOCK_SHUTTLE_MOVEMENT))
return
. = ..()
if(client && movement_force)