From d74568dece8316adcf03fedcc3a63aa2626e5699 Mon Sep 17 00:00:00 2001 From: Matt Atlas Date: Sun, 1 May 2022 02:16:03 +0200 Subject: [PATCH] Examining things no longer forces you to look at them. (#13700) --- code/_onclick/click.dm | 4 +- code/modules/mob/mob.dm | 4 +- code/modules/projectiles/gun.dm | 2 + .../projectiles/targeting/targeting_gun.dm | 2 +- html/changelogs/mattatlas-examiinefix.yml | 41 +++++++++++++++++++ 5 files changed, 48 insertions(+), 5 deletions(-) create mode 100644 html/changelogs/mattatlas-examiinefix.yml diff --git a/code/_onclick/click.dm b/code/_onclick/click.dm index b49b6804606..afa10f50cd4 100644 --- a/code/_onclick/click.dm +++ b/code/_onclick/click.dm @@ -337,7 +337,7 @@ handle_regular_hud_updates() // Simple helper to face what you clicked on, in case it should be needed in more than one place -/mob/proc/face_atom(var/atom/A) +/mob/proc/face_atom(var/atom/A, var/force_face = FALSE) if(!A || !x || !y || !A.x || !A.y) return var/dx = A.x - x var/dy = A.y - y @@ -359,7 +359,7 @@ direction = WEST if(direction != dir) - facedir(direction, TRUE) + facedir(direction, force_face) var/global/list/click_catchers diff --git a/code/modules/mob/mob.dm b/code/modules/mob/mob.dm index 2bbb3e4b83c..50506b2aea1 100644 --- a/code/modules/mob/mob.dm +++ b/code/modules/mob/mob.dm @@ -955,10 +955,10 @@ return canmove -/mob/proc/facedir(var/ndir) +/mob/proc/facedir(var/ndir, var/force_change = FALSE) if(!canface() || (client && client.moving)) return 0 - if(facing_dir != ndir) + if((facing_dir != ndir) && force_change) facing_dir = null set_dir(ndir) if(buckled_to && buckled_to.buckle_movable) diff --git a/code/modules/projectiles/gun.dm b/code/modules/projectiles/gun.dm index 2a104573ca6..90ff3953919 100644 --- a/code/modules/projectiles/gun.dm +++ b/code/modules/projectiles/gun.dm @@ -311,6 +311,8 @@ user.setClickCooldown(shoot_time) user.setMoveCooldown(shoot_time) next_fire_time = world.time + shoot_time + + user.face_atom(target, TRUE) return TRUE diff --git a/code/modules/projectiles/targeting/targeting_gun.dm b/code/modules/projectiles/targeting/targeting_gun.dm index a443d5d34e2..998b1225e78 100644 --- a/code/modules/projectiles/targeting/targeting_gun.dm +++ b/code/modules/projectiles/targeting/targeting_gun.dm @@ -14,7 +14,7 @@ /obj/item/gun/proc/PreFire(var/atom/A, var/mob/living/user, var/params) if(!user.aiming) user.aiming = new(user) - user.face_atom(A) + user.face_atom(A, TRUE) if(ismob(A) && user.aiming) user.aiming.aim_at(A, src) return 1 diff --git a/html/changelogs/mattatlas-examiinefix.yml b/html/changelogs/mattatlas-examiinefix.yml new file mode 100644 index 00000000000..acd0d362f4b --- /dev/null +++ b/html/changelogs/mattatlas-examiinefix.yml @@ -0,0 +1,41 @@ +################################ +# Example Changelog File +# +# Note: This file, and files beginning with ".", and files that don't end in ".yml" will not be read. If you change this file, you will look really dumb. +# +# Your changelog will be merged with a master changelog. (New stuff added only, and only on the date entry for the day it was merged.) +# When it is, any changes listed below will disappear. +# +# Valid Prefixes: +# bugfix +# wip (For works in progress) +# tweak +# soundadd +# sounddel +# rscadd (general adding of nice things) +# rscdel (general deleting of nice things) +# imageadd +# imagedel +# maptweak +# spellcheck (typo fixes) +# experiment +# balance +# admin +# backend +# security +# refactor +################################# + +# Your name. +author: MattAtlas + +# Optional: Remove this file after generating master changelog. Useful for PR changelogs that won't get used again. +delete-after: True + +# Any changes you've made. See valid prefix list above. +# INDENT WITH TWO SPACES. NOT TABS. SPACES. +# SCREW THIS UP AND IT WON'T WORK. +# Also, all entries are changed into a single [] after a master changelog generation. Just remove the brackets when you add new entries. +# Please surround your changes in double quotes ("), as certain characters otherwise screws up compiling. The quotes will not show up in the changelog. +changes: + - bugfix: "Examining things no longer forces you to look at them."