Fixes spray painters consuming double ammo when painting pipes by CawsForConcern · Pull Request #2199 · ss14Starlight/space-station-14 (original) (raw)
Short description
Fixes a bug introduced in #1553 where the function OnPipeInteract() was calling .TryUseCharges() which made it consume a paint charge when you started painting a pipe.
After the doAfter finished, the function OnPipeDoAfter(), would call .TryUseCharges() again and consume a second paint charge.
Note: I reverted the code for OnPipeInteract() to upstream, hence why there's no Starlight comments there. I've adjusted the Starlight comments as needed in OnPipeDoAfter()
Why we need to add this
Spray painting pipes is intended to cost 1 paint, not 2. I was wondering why I ran out of paint so quickly when painting pipes in Atmospherics.
Media (Video/Screenshots)
2025-11-13.20-59-22.mp4
fig 1. - Fixes shown:
- Spray painters only consume 1 paint when painting pipes, as intended
- Spray painters don't consume a paint charge if you start painting but then cancel the doAfter
- Spray painters now show a "Not enough paint" message if you run out of charges after having queued up a bunch of spray paints on pipes. Nice QoL change
Checks
- I do not require assistance to complete the PR.
- Before posting/requesting review of a PR, I have verified that the changes work.
- I have added screenshots/videos of the changes, or this PR does not change in-game mechanics.
- I affirm that my changes are licensed under the Starlight Fork License and grant permission for use in this repository under its conditions.
Changelog
🆑 CawsForConcern
- fix: Spray painters no longer consume 2 paint charges when painting pipes (now correctly consume only 1 charge)