From ef8866db051915a2ded3d2304db901f03945d039 Mon Sep 17 00:00:00 2001 From: Seth Scherer Date: Thu, 31 Mar 2022 17:48:48 -0400 Subject: [PATCH] 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 --- code/modules/client/client_defines.dm | 4 -- code/modules/mob/mob.dm | 71 --------------------------- 2 files changed, 75 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 fa19d1dffd6..fdb7c42903c 100644 --- a/code/modules/mob/mob.dm +++ b/code/modules/mob/mob.dm @@ -797,77 +797,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)