Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Misc Fixes #359

Merged
merged 17 commits into from
Aug 9, 2024
Merged

Misc Fixes #359

merged 17 commits into from
Aug 9, 2024

Conversation

Doubleumc
Copy link
Contributor

About the pull request

A slew of miscellaneous fixes. No particular reason for these specific ones other than it caught my eye or was necessary for another.

Explain why it's good for the game

Fixes good.

Testing Photographs and Procedure

Screenshots & Videos

Put screenshots and videos here with an empty line between the screenshots and the <details> tags.

Changelog

🆑
qol: Adds the ability to hide your action buttons
fix: Fixed 'hidden' action buttons being shown to observing players.
qol: Made any observers transfer over when a Xenomorph evolves/de-evolves.
add: Added 'observe' functionality to Xenomorphs, allowing observers to view the target's UI.
add: Made observing a player also show their action buttons.
spellcheck: Made observers see the marine version of CAS warnings, rather than the xeno one.
qol: Made open TGUI windows transfer over when a xeno player evolves.
fix: Fixed observing a monkey/farwa/stok/etc. locking the camera onto it.
fix: Observer minimap should no longer occasionally show wrong / no map.
code: environmental reverb applies more reliably and only to positional sounds
fix: Notifications should no longer emit light.
fix: Sprite-click shots onto Xenos are no longer affected by limb-targeting penalty, because it was an accuracy debuff when there is no inherent benefit to targeting Xeno limbs.
add: Locking down dropship's doors closes them before locking.
fix: Fix handling of sentry_computer deletion
refactor: Refactored the overlay_lighting component to better handle objects deleting
fix: Fix putting lights in bags somereason keeping the light on
refactor: sentry laptop now uses camera manager component
/:cl:

mullenpaul and others added 17 commits August 5, 2024 20:47
The sentry laptop had a bunch of custom code for handling gunsight
cameras. This PR refactors it to exclusively use the camera_manager
component.

<!-- Remove this text and explain what the purpose of your PR is.

Mention if you have tested your changes. If you changed a map, make sure
you used the mapmerge tool.
If this is an Issue Correction, you can type "Fixes Issue #169420" to
link the PR to the corresponding Issue number #169420.

Remember: something that is self-evident to you might not be to others.
Explain your rationale fully, even if you feel it goes without saying.
-->

Reduction of duplicated code.
<details>
<summary>Screenshots & Videos</summary>

Put screenshots and videos here with an empty line between the
screenshots and the `<details>` tags.

</details>

:cl:
refactor: sentry laptop now uses camera manager component
/:cl:
This PR ports tgstation/tgstation#79939 and
fixes a few other things in the overlay_lighting component.

Less hard deletes and lights in objects disables the light (despite
actually still being on).

Fixes:

https://github.com/cmss13-devs/cmss13/assets/76988376/4a89b0de-ccb2-4d80-a081-2ec2d311f753
<details>
<summary>Screenshots & Videos</summary>

![flares](https://github.com/cmss13-devs/cmss13/assets/76988376/12765f93-78e9-42f3-90f9-5118ad62af65)

https://github.com/cmss13-devs/cmss13/assets/76988376/cb7b2d6d-9f2d-4e0e-86cd-82371582524e

</details>
:cl: Drathek
refactor: Refactored the overlay_lighting component to better handle
objects deleting
fix: Fix putting lights in bags somereason keeping the light on
/:cl:
…#5345)

This PR resolves some runtimes and the bricking of a multitool if it is
loaded with a deleted sentry. The weakref resolve in the multitool
wasn't checked if the resolve passed. Additionally, the sentries would
remain encrypted to a non-existent computer. If bricking an encrypted
sentry is intended, it needs to be handled more gracefully.

Fixes a runtime when using a multitool linked to a deleted
sentry_computer:

![image](https://github.com/cmss13-devs/cmss13/assets/76988376/4db7c411-aff1-4b56-9cee-b2cec6e05519)

Fixes a runtime when using said multitool to unpair the sentry from a
deleted sentry_computer.

![image](https://github.com/cmss13-devs/cmss13/assets/76988376/946f002d-2246-4632-a554-e2cfd6ad5a9d)
<details>
<summary>Screenshots & Videos</summary>

1. Link tuner w/ a laptop
2. Delete laptop
3. Spawn a new laptop
4. Use tuner on new laptop
5. Runtime when trying to clear because the weakref resolve wasn't
checked.

https://github.com/cmss13-devs/cmss13/assets/76988376/bfe447ce-a6dc-4d88-b3e8-b4ee6efb1daf

</details>
:cl: Drathek
fix: Fix handling of sentry_computer deletion
/:cl:
Lockdown actually closes doors on DS.

It used to be the case before the gui rework. I think. Anyway DP should
be able to control doors, hunting for the moment when all doors are
closed to lock them is extremely not fun.

<details>
:)</details>

:cl: ihatethisengine
add: Locking down dropship's doors closes them before locking.
/:cl:
<!-- Remove this text and explain what the purpose of your PR is.

Mention if you have tested your changes. If you changed a map, make sure
you used the mapmerge tool.
If this is an Issue Correction, you can type "Fixes Issue #169420" to
link the PR to the corresponding Issue number #169420.

Remember: something that is self-evident to you might not be to others.
Explain your rationale fully, even if you feel it goes without saying.
-->

Selecting a body part on doll at bottom right applies an inherent
accuracy debuff to shots (an hand is harder to hit than chest).

This penalty still applied to sprite-click attacks on Xenomorphs,
despite the localized damage having no effect.

This means that you'd have to constantly reset your aimed part to chest
every time you try to shoot a Xeno, or would suffer a "free" penalty.

Old flow went as follow:
 * Get base Hit Chance and Roll
* If it's only a near hit, or target's not the shot clicked target, the
shot targeted limb is reset to a random one
 * Hit chance receives a penalty based on aimed limb
 * We proceed checking hit chance vs roll

Because of the above problem this is changed to:

* Get base Hit Chance and Roll
* If it's a near hit (including limb penalty), a near xeno hit
(excluding limb penalty), or not the sprite-clicked target, aimed limb
is reset to a random one
* Else if the target is a xeno and it was a proper direct hit, there is
no penalty -- functionally similar to a chest shot
* Else Finally, apply per-limb penalty as usual
* We proceed checking hit chance vs roll

Avoids an invisible noobtrap debuff for just about everyone in the game
that isn't in the know - and the neccessity to constantly reset
targeting to chest for medics.

The problem was tested by a player on discord -- the fix i tested just
was spawning stuff and shooting up the place observing RNG misses. I did
not take detailed statistics over time to confirm.

:cl:
fix: Sprite-click shots onto Xenos are no longer affected by
limb-targeting penalty, because it was an accuracy debuff when there is
no inherent benefit to targeting Xeno limbs.
/:cl:
# About the pull request
Fixes #5985, albeit there might be a better approach.

# Explain why it's good for the game
bug fix, tested it with the steps listed in the issue. Worked as far as
I could tell.

# Changelog
:cl:
fix: Notifications should no longer emit light.
/:cl:

---------

Co-authored-by: DOOM <N/A>
Changes to how a client's sound `environment`  and `echo` is handled:
https://www.byond.com/docs/ref/#/sound/var/environment
https://www.byond.com/docs/ref/#/sound/var/echo

A client's `soundOutput` now has sole control over environment and echo.
The environment is updated when the mob moves into a different area, or
if the mob's environment override is set.
The echo is used to enable or disable the environmental reverb
per-sound.

<!-- Remove this text and explain what the purpose of your PR is.

Mention if you have tested your changes. If you changed a map, make sure
you used the mapmerge tool.
If this is an Issue Correction, you can type "Fixes Issue #169420" to
link the PR to the corresponding Issue number #169420.

Remember: something that is self-evident to you might not be to others.
Explain your rationale fully, even if you feel it goes without saying.
-->

Issue: an environment applies to all sounds for that client, current and
future, until another one is set. It applies to in-world sounds as well
as, say, admin pings.

Solution: since an echo is applied per-sound, by adjusting the echo's
Room & RoomHF fields the environmental effects can be enabled or
disabled (more accurately, made so quiet as to be inaudible). This is
set to off by default, and is only enabled for positional sounds. Admin
pings are safe.

Idea from here: tgstation/tgstation#55333
Boots without issue. Sound environments change at appropriate points.
Sound environments effect only positional sounds.
:cl:
code: environmental reverb applies more reliably and only to positional
sounds
/:cl:
Fixes annoying bug involving jumptocoord hrefs in some deadchat
messages, making ghost's minimap desync with the map observer is in.
<!-- Remove this text and explain what the purpose of your PR is.

Mention if you have tested your changes. If you changed a map, make sure
you used the mapmerge tool.
If this is an Issue Correction, you can type "Fixes Issue #169420" to
link the PR to the corresponding Issue number #169420.

Remember: something that is self-evident to you might not be to others.
Explain your rationale fully, even if you feel it goes without saying.
-->
Bugs bad. Removing bugs good.
<details>
<summary>Screenshots & Videos</summary>

Put screenshots and videos here with an empty line between the
screenshots and the `<details>` tags.

</details>
:cl: MrDas
fix: Observer minimap should no longer occasionally show wrong / no map.
/:cl:
<!-- Write **BELOW** The Headers and **ABOVE** The comments else it may
not be viewable. -->

Fixes orbiting a monkey/farwa/stok/etc. locking your camera onto it.

This was happening due to `RegisterSignal(src, COMSIG_MOVABLE_MOVED,
PROC_REF(observer_move_react))` not being called if the target mob
didn't have a HUD, meaning that the client's `eye` wouldn't be set back
to their body when they tried moving away.
I also moved the `COMSIG_PARENT_QDELETING` one over too so that the same
doesn't happen if the target mob is deleted.

(The other signals all seem to be HUD related.)

Bug!
<!-- Include any screenshots/videos/debugging steps of the modified code
functioning successfully, ideally including edge cases. -->
<details>
<summary>Screenshots & Videos</summary>

https://github.com/cmss13-devs/cmss13/assets/57483089/c188db1f-4fb2-4634-baeb-b87ab6e17ae8

https://github.com/cmss13-devs/cmss13/assets/57483089/05348463-49ed-442c-80c3-9c880b4f3d91

https://github.com/cmss13-devs/cmss13/assets/57483089/3f0c8da7-d688-4523-8f63-9f743e699326

https://github.com/cmss13-devs/cmss13/assets/57483089/b39eefa3-3138-437b-bffe-89813ee0a46b

</details>

<!-- If your PR modifies aspects of the game that can be concretely
observed by players or admins you should add a changelog. If your change
does NOT meet this description, remove this section. Be sure to properly
label your changes in the changelog. Please note that maintainers freely
reserve the right to remove and add tags should they deem it
appropriate. You can attempt to finagle the system all you want, but
it's best to shoot for clear communication right off the bat. -->
<!-- If you add a name after the ':cl', that name will be used in the
changelog. You must add your CKEY after the CL if your GitHub name
doesn't match. Maintainers freely reserve the right to remove and add
tags should they deem it appropriate. -->

:cl:
fix: Fixed observing a monkey/farwa/stok/etc. locking the camera onto
it.
/:cl:

<!-- Both :cl:'s are required for the changelog to work! -->
Makes any open TGUI windows transfer over when a player's mind is
transferred to a new body. *(At least if it's done through
`/datum/mind/proc/transfer_to()`)*
This is mainly useful for xeno players who want to evolve, since it
means they won't need to re-open any interfaces they had open.

The changes in `code/controllers/subsystem/minimap.dm` are there so that
the tacmap image remains visible to the player after a transfer, since
the client changing bodies seems to remove it from their
[`screen`](https://www.byond.com/docs/ref/#/client/var/screen) list.

(This *could* have hidden side effects of interfaces staying open when
they shouldn't, so I'd appreciate this being testmerged for a bit just
in case.)

QOL addition so that you don't have to manually re-open them yourself.
<details>
<summary>Screenshots & Videos</summary>

https://github.com/cmss13-devs/cmss13/assets/57483089/70549c92-915b-4881-95ca-d1625a346f4b

</details>
:cl:
qol: Made open TGUI windows transfer over when a xeno player evolves.
/:cl:
Makes the CAS warning messages for observers say 'Dropship' rather than
'Large bird'.

It seems a bit weird that observers get the "in-character" xeno version
of the messages, rather than the "correct" version.
<details>
<summary>Screenshots & Videos</summary>

Put screenshots and videos here with an empty line between the
screenshots and the `<details>` tags.

</details>
(no idea what CL category to make this)

:cl:
spellcheck: Made observers see the marine version of CAS warnings,
rather than the xeno one.
/:cl:
…uttons) (#5751)

Makes auto-observing work for xenomorphs *and* humans by moving it to
`/carbon`, and also makes it show the target's action buttons.

I'm pretty confident that this all works correctly, but I would still
recommend testmerging it anyway.
It's ~~probable~~possible that I missed something somewhere and an
observer could get stuck being unable to click anything, or something
like that.

This makes auto-observing a bit more consistent, more interesting for
observers, and could actually help newer players to learn how to play
some castes. (Which abilities to use and when, where to target, etc.)
<details>
<summary>Screenshots & Videos</summary>

https://github.com/cmss13-devs/cmss13/assets/57483089/54fbb8c6-f9fa-444b-b80c-228b4e6e3480

</details>
:cl:
add: Added 'observe' functionality to Xenomorphs, allowing observers to
view the target's UI.
add: Made observing a player also show their action buttons.
/:cl:
Fixes/tweaks a couple of auto-observe things that I noticed after #5751.
Specifically:
- Fixes `runtime error: client_screen_add overridden. Use override =
TRUE to suppress this warning`/`runtime error: client_screen_remove
overridden. Use override = TRUE to suppress this warning`.
*This error was consistently thrown when a ghost who's body is being
observed re-enters their body. `observe_target_new_mind()` tries to
re-register the some signals on the body's new client, but didn't have
the `override` argument set.*

- Stops 'hidden' actions being added to the screen of observing players.
(e.g. the xeno tacmap action if the queen isn't ovied)

- Makes any observers transfer over to the new body when a xenomorph
evolves/de-evolves.
*(I also added `/mob/dead/observer` to the `observers` variable's
declaration since it wasn't particularly clear what the list held.)*

- Fixes the target player's action buttons disappearing for observers if
they reconnect or re-enter their body.
*(The actions were being shown to the player in
`Login()`>`show_hud()`>`update_action_buttons()` before the observer
could re-register signals in `observe_target_login()`.)
In order to fix this I renamed the existing `COMSIG_GLOB_MOB_LOGIN`,
`COMSIG_CLIENT_MOB_LOGIN`, `COMSIG_MOB_LOGIN` signals, and made
`COMSIG_MOB_LOGIN` send a bit earlier in the proc.*

Bugfixes :)

<details>
<summary>Screenshots & Videos</summary>

Put screenshots and videos here with an empty line between the
screenshots and the `<details>` tags.

</details>

:cl:
fix: Fixed 'hidden' action buttons being shown to observing players.
qol: Made any observers transfer over when a Xenomorph
evolves/de-evolves.
/:cl:
Adds a verb on /client to show/hide action buttons
Makes it a new variable, as var/hidden also prevents the action from
being used

![image](https://github.com/cmss13-devs/cmss13/assets/56142455/1d78441c-5085-4165-a2b7-f7c3e9f7e2c3)

:cl:
qol: Adds the ability to hide your action buttons
/:cl:
@Doubleumc Doubleumc requested a review from fira as a code owner August 6, 2024 07:36
@Doubleumc Doubleumc merged commit 5a75cc1 into cmss13-devs:master Aug 9, 2024
36 checks passed
@Doubleumc Doubleumc deleted the misc-fixes branch August 9, 2024 05:35
cm13-github added a commit that referenced this pull request Aug 9, 2024
@Doubleumc Doubleumc mentioned this pull request Aug 13, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

9 participants