From 2f591a301cf4248a2a901499c98321a866ae07fa Mon Sep 17 00:00:00 2001 From: DGamerL <108773801+DGamerL@users.noreply.github.com> Date: Sun, 4 Aug 2024 11:07:03 +0200 Subject: [PATCH] Makes people on skateboards unable to pull things (#26191) * Makes people on skateboards unable to pull things * Removes duplicate definition * Contra review --- code/_globalvars/traits.dm | 3 ++- code/datums/components/riding/riding.dm | 8 +++----- code/modules/mob/living/living.dm | 1 + code/modules/vehicle/tg_vehicles/tg_vehicles.dm | 1 - 4 files changed, 6 insertions(+), 7 deletions(-) diff --git a/code/_globalvars/traits.dm b/code/_globalvars/traits.dm index 8db9526d525..e6b68fcbdda 100644 --- a/code/_globalvars/traits.dm +++ b/code/_globalvars/traits.dm @@ -98,7 +98,8 @@ GLOBAL_LIST_INIT(traits_by_type, list( "TRAIT_ABSTRACT_HANDS" = TRAIT_ABSTRACT_HANDS, "TRAIT_LANGUAGE_LOCKED" = TRAIT_LANGUAGE_LOCKED, "TRAIT_HAS_IV_BAG" = TRAIT_HAS_IV_BAG, - "TRAIT_NON_INFECTIOUS_ZOMBIE" = TRAIT_NON_INFECTIOUS_ZOMBIE + "TRAIT_NON_INFECTIOUS_ZOMBIE" = TRAIT_NON_INFECTIOUS_ZOMBIE, + "TRAIT_CANNOT_PULL" = TRAIT_CANNOT_PULL ), /datum/mind = list( diff --git a/code/datums/components/riding/riding.dm b/code/datums/components/riding/riding.dm index 5f6fe5ff12e..149ea6ca655 100644 --- a/code/datums/components/riding/riding.dm +++ b/code/datums/components/riding/riding.dm @@ -100,13 +100,11 @@ rider.stop_pulling() RegisterSignal(rider, COMSIG_LIVING_TRY_PULL, PROC_REF(on_rider_try_pull)) -/// This proc is called when the rider attempts to grab the thing they're riding, preventing them from doing so. +/// This proc is called when the rider attempts to grab something, preventing them from doing so. /datum/component/riding/proc/on_rider_try_pull(mob/living/rider_pulling, atom/movable/target, force) SIGNAL_HANDLER // COMSIG_LIVING_TRY_PULL - if(target == parent) - var/mob/living/ridden = parent - to_chat(ridden, "You can't pull [target]!") - return COMSIG_LIVING_CANCEL_PULL + to_chat(rider_pulling, "You can't pull [target]!") + return COMSIG_LIVING_CANCEL_PULL /// Some ridable atoms may want to only show on top of the rider in certain directions, like wheelchairs /datum/component/riding/proc/handle_vehicle_layer(dir) diff --git a/code/modules/mob/living/living.dm b/code/modules/mob/living/living.dm index c986e24f10d..7dd6b5182af 100644 --- a/code/modules/mob/living/living.dm +++ b/code/modules/mob/living/living.dm @@ -1002,6 +1002,7 @@ return if(SEND_SIGNAL(src, COMSIG_LIVING_TRY_PULL, AM, force) & COMSIG_LIVING_CANCEL_PULL) return FALSE + // If we're pulling something then drop what we're currently pulling and pull this instead. AM.add_fingerprint(src) if(pulling) diff --git a/code/modules/vehicle/tg_vehicles/tg_vehicles.dm b/code/modules/vehicle/tg_vehicles/tg_vehicles.dm index acdcadef70e..7687e66c8c6 100644 --- a/code/modules/vehicle/tg_vehicles/tg_vehicles.dm +++ b/code/modules/vehicle/tg_vehicles/tg_vehicles.dm @@ -227,7 +227,6 @@ /obj/tgvehicle/buckle_mob(mob/living/M, force = FALSE, check_loc = TRUE) if(!force && occupant_amount() >= max_occupants) return FALSE - return ..() /obj/tgvehicle/zap_act(power, zap_flags)