From 9c53a34072a3ff706326ee5f740f7e6ced1dbf93 Mon Sep 17 00:00:00 2001 From: SkyratBot <59378654+SkyratBot@users.noreply.github.com> Date: Fri, 1 Apr 2022 02:52:26 +0200 Subject: [PATCH] [MIRROR] Removes some unused mob verbs + client vars [MDB IGNORE] (#12438) * Removes some unused mob verbs + client vars (#65732) * Removes an unused var from /client `inprefs` isn't used anywhere, i checked to when it was added (~5 years ago) and it wasn't even really used then. I think it used to be used to track topic calls / slowdown some href issues but it isn't any more. Byebye!! * Removes some unused mob verbs + client var `canface` and `east/west/north/southface` used to be used to set direction but these are no longer used and are thus taking up unnecessary space * Removes some unused mob verbs + client vars * Update pixel_shift.dm Co-authored-by: Seth Scherer Co-authored-by: Gandalf <9026500+Gandalf2k15@users.noreply.github.com> --- code/modules/client/client_defines.dm | 4 -- code/modules/mob/mob.dm | 71 ------------------- .../modules/pixel_shift/code/pixel_shift.dm | 8 --- 3 files changed, 83 deletions(-) diff --git a/code/modules/client/client_defines.dm b/code/modules/client/client_defines.dm index 2d32aa99586..10a9a51eb5c 100644 --- a/code/modules/client/client_defines.dm +++ b/code/modules/client/client_defines.dm @@ -70,8 +70,6 @@ ///////// ///Player preferences datum for the client var/datum/preferences/prefs = null - ///last turn of the controlled mob, I think this is only used by mechs? - var/last_turn = 0 ///Move delay of controlled mob, any keypresses inside this period will persist until the next proper move var/move_delay = 0 ///The visual delay to use for the current client.Move(), mostly used for making a client based move look like it came from some other slower source @@ -133,8 +131,6 @@ ///world.timeofday they connected var/connection_timeofday - ///If the client is currently in player preferences - var/inprefs = FALSE ///Used for limiting the rate of topic sends by the client to avoid abuse var/list/topiclimiter ///Used for limiting the rate of clicks sends by the client to avoid abuse diff --git a/code/modules/mob/mob.dm b/code/modules/mob/mob.dm index 801303dc5d1..03b68af917d 100644 --- a/code/modules/mob/mob.dm +++ b/code/modules/mob/mob.dm @@ -819,77 +819,6 @@ L[++L.len] = list("[S.panel]", "[S.holder_var_type] [S.holder_var_amount]", S.name, REF(S)) return L -#define MOB_FACE_DIRECTION_DELAY 1 - -// facing verbs -/** - * Returns true if a mob can turn to face things - * - * Conditions: - * * client.last_turn > world.time - * * not dead or unconcious - * * not anchored - * * no transform not set - * * we are not restrained - */ -/mob/proc/canface() - if(world.time < client.last_turn) - return FALSE - if(stat >= UNCONSCIOUS) - return FALSE - if(anchored) - return FALSE - if(notransform) - return FALSE - if(HAS_TRAIT(src, TRAIT_RESTRAINED)) - return FALSE - return TRUE - -///Checks mobility move as well as parent checks -/mob/living/canface() - if(!(mobility_flags & MOBILITY_MOVE)) - return FALSE - return ..() - -/mob/dead/observer/canface() - return TRUE - -///Hidden verb to turn east -/mob/verb/eastface() - set hidden = TRUE - if(!canface()) - return FALSE - setDir(EAST) - client.last_turn = world.time + MOB_FACE_DIRECTION_DELAY - return TRUE - -///Hidden verb to turn west -/mob/verb/westface() - set hidden = TRUE - if(!canface()) - return FALSE - setDir(WEST) - client.last_turn = world.time + MOB_FACE_DIRECTION_DELAY - return TRUE - -///Hidden verb to turn north -/mob/verb/northface() - set hidden = TRUE - if(!canface()) - return FALSE - setDir(NORTH) - client.last_turn = world.time + MOB_FACE_DIRECTION_DELAY - return TRUE - -///Hidden verb to turn south -/mob/verb/southface() - set hidden = TRUE - if(!canface()) - return FALSE - setDir(SOUTH) - client.last_turn = world.time + MOB_FACE_DIRECTION_DELAY - return TRUE - /mob/proc/swap_hand() var/obj/item/held_item = get_active_held_item() if(SEND_SIGNAL(src, COMSIG_MOB_SWAP_HANDS, held_item) & COMPONENT_BLOCK_SWAP) diff --git a/modular_skyrat/modules/pixel_shift/code/pixel_shift.dm b/modular_skyrat/modules/pixel_shift/code/pixel_shift.dm index f69b3070302..5ad7c87d12d 100644 --- a/modular_skyrat/modules/pixel_shift/code/pixel_shift.dm +++ b/modular_skyrat/modules/pixel_shift/code/pixel_shift.dm @@ -42,26 +42,18 @@ /mob/living/pixel_shift(direction) switch(direction) if(NORTH) - if(!canface()) - return FALSE if(pixel_y <= 16 + base_pixel_y) pixel_y++ is_shifted = TRUE if(EAST) - if(!canface()) - return FALSE if(pixel_x <= 16 + base_pixel_x) pixel_x++ is_shifted = TRUE if(SOUTH) - if(!canface()) - return FALSE if(pixel_y >= -16 + base_pixel_y) pixel_y-- is_shifted = TRUE if(WEST) - if(!canface()) - return FALSE if(pixel_x >= -16 + base_pixel_x) pixel_x-- is_shifted = TRUE