Skip to content

Commit

Permalink
[MIRROR] Fix not being able to stop looking vertically (#2786)
Browse files Browse the repository at this point in the history
* Fix not being able to stop looking vertically (#83503)

## About The Pull Request
This fixes a bug with the look down/up verbs where you are not able to
*stop* looking unless you're on a tile where you're able to *start*
looking.

## Why It's Good For The Game

![image](https://github.com/tgstation/tgstation/assets/16826524/6cafddbb-2f52-47d5-839e-dfac1595521d)


## Changelog
:cl:
fix: you are now able to cancel the look up/down verbs from anywhere
/:cl:

* Fix not being able to stop looking vertically

---------

Co-authored-by: Echriser <[email protected]>
Co-authored-by: NovaBot13 <[email protected]>
  • Loading branch information
3 people authored and StealsThePRs committed Jun 1, 2024
1 parent e5c22db commit 93eb00d
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
8 changes: 6 additions & 2 deletions code/modules/mob/living/living.dm
Original file line number Diff line number Diff line change
Expand Up @@ -2226,6 +2226,7 @@ GLOBAL_LIST_EMPTY(fire_appearances)
to_chat(src, span_warning("You can't see through the floor above you."))
return

looking_vertically = TRUE
reset_perspective(ceiling)

/mob/living/proc/stop_look_up()
Expand All @@ -2234,6 +2235,7 @@ GLOBAL_LIST_EMPTY(fire_appearances)

/mob/living/proc/end_look_up()
stop_look_up()
looking_vertically = FALSE
UnregisterSignal(src, COMSIG_MOVABLE_PRE_MOVE)
UnregisterSignal(src, COMSIG_MOVABLE_MOVED)

Expand Down Expand Up @@ -2276,6 +2278,7 @@ GLOBAL_LIST_EMPTY(fire_appearances)
to_chat(src, span_warning("You can't see through the floor below you."))
return

looking_vertically = TRUE
reset_perspective(lower_level)

/mob/living/proc/stop_look_down()
Expand All @@ -2284,6 +2287,7 @@ GLOBAL_LIST_EMPTY(fire_appearances)

/mob/living/proc/end_look_down()
stop_look_down()
looking_vertically = FALSE
UnregisterSignal(src, COMSIG_MOVABLE_PRE_MOVE)
UnregisterSignal(src, COMSIG_MOVABLE_MOVED)

Expand Down Expand Up @@ -2781,7 +2785,7 @@ GLOBAL_LIST_EMPTY(fire_appearances)
set name = "Look Up"
set category = "IC"

if(client.perspective != MOB_PERSPECTIVE)
if(looking_vertically)
end_look_up()
else
look_up()
Expand All @@ -2790,7 +2794,7 @@ GLOBAL_LIST_EMPTY(fire_appearances)
set name = "Look Down"
set category = "IC"

if(client.perspective != MOB_PERSPECTIVE)
if(looking_vertically)
end_look_down()
else
look_down()
Expand Down
3 changes: 3 additions & 0 deletions code/modules/mob/living/living_defines.dm
Original file line number Diff line number Diff line change
Expand Up @@ -214,6 +214,9 @@
///what multiplicative slowdown we get from turfs currently.
var/current_turf_slowdown = 0

/// Is the mob looking vertically
var/looking_vertically = FALSE

/// Living mob's mood datum
var/datum/mood/mob_mood

Expand Down

0 comments on commit 93eb00d

Please sign in to comment.