From fdedc69bc73f1ada8517b2dfde7f02bcd5d69f36 Mon Sep 17 00:00:00 2001 From: Tempest Date: Tue, 28 Jul 2026 12:51:08 -0500 Subject: [PATCH] Fix gunpoint lock-on being logged against the victim instead of the aimer (#6023) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ## About The Pull Request Closes #5986. `/datum/gunpoint/lock_on()` called: ```dm log_combat(target, source, "locked onto with aiming") ``` `log_combat()`'s signature is `(atom/user, atom/target, what_done, atom/object, addition)` — the first argument is the actor and the second is who it was done to. These were passed the other way round, so every successful lock-on wrote `locked onto with aiming ` into the **target's** attack log, and handed the person actually holding the gun the `LOG_VICTIM` line `was locked onto with aiming by `. This is easy to miss when reading the file, because every *other* use of `source`/`target` in the datum is correct — the `visible_message()` calls all render the right way round, so chat reads correctly and only the logs are inverted. It only becomes obvious in the situation from the issue report, where one person was aimed at by several others and the logs read as though that person had gunpointed the entire room. The fix swaps the two arguments. It also passes `aimed_gun` as the `object` param, which the call was leaving empty — chat already tells everyone which gun is being aimed, and the log now records it too. ## Why It's Good For The Game Gunpointing is an escalation step, so its logs are evidence admins act on. As written, the logs named the victim as the aggressor, which is worse than having no log at all — it points admin attention at exactly the wrong player. Recording the gun as well saves a cross-reference against the chat log when working out what someone was actually being held at gunpoint with. ## Proof Of Testing Tested on a local server (Delta Station), aiming a foam force crossbow at a mothroach and at a human, and reading back both the in-round Individual Logs panel and `attack.log` on disk. `attack.log` after the fix — the actor is the mob holding the crossbow, the target is named as the object of the sentence, and the weapon now appears: ``` [2026-07-28 12:57:43.747] ATTACK: '(centralsmith)'/(Mackenzie Hooker) (mob_3144) locked onto with aiming *no key*/(Mr. Fluff) with the foam force crossbow (NEWHP: 25) (Recreation Area (214,97,2)) [2026-07-28 13:00:31.909] ATTACK: '(centralsmith)'/(Mackenzie Hooker) (mob_3144) locked onto with aiming *no key*/(Izabella Compton) with the foam force crossbow (NEWHP: 100) (Recreation Area (213,100,2)) ``` Before this PR, those lines were filed against Mr. Fluff and Izabella Compton — the ones being aimed at. Mr. Fluff is a mothroach, which makes the old attribution particularly clear: the log claimed the mothroach was the one locking on with a crossbow. Note that only the actor's line reaches disk; the matching `was locked onto with aiming by ...` victim line is written with `log_globally = FALSE`, so it appears in the Individual Logs panel only.
Screenshots/Videos https://github.com/user-attachments/assets/0d619ecf-0ba8-4045-b9ea-09b65ec2b696
## Changelog :cl: admin: Aiming a gun at someone is now logged against the person doing the aiming, rather than against the person being aimed at. The gun used is included in the log. /:cl: Co-authored-by: Centrsmith Co-authored-by: Claude Opus 5 --- modular_skyrat/modules/gunpoint/code/gunpoint_datum.dm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modular_skyrat/modules/gunpoint/code/gunpoint_datum.dm b/modular_skyrat/modules/gunpoint/code/gunpoint_datum.dm index a10cf315529..ef482319e9c 100644 --- a/modular_skyrat/modules/gunpoint/code/gunpoint_datum.dm +++ b/modular_skyrat/modules/gunpoint/code/gunpoint_datum.dm @@ -57,7 +57,7 @@ qdel(src) return locked = TRUE - log_combat(target, source, "locked onto with aiming") + log_combat(source, target, "locked onto with aiming", aimed_gun) playsound(get_turf(source), 'modular_skyrat/modules/gunpoint/sound/targeton.ogg', 50,1) to_chat(source, span_notice("You lock onto [target.name]!")) target.visible_message(span_warning("[source.name] holds [target.name] at gunpoint with the [aimed_gun.name]!"), span_userdanger("[source.name] holds you at gunpoint with the [aimed_gun.name]!"))