Skip to content

Add Multi-Z handling to get_line - #13027

Open
MistChristmas wants to merge 4 commits into
cmss13-devs:masterfrom
MistChristmas:LogicalZToss
Open

Add Multi-Z handling to get_line#13027
MistChristmas wants to merge 4 commits into
cmss13-devs:masterfrom
MistChristmas:LogicalZToss

Conversation

@MistChristmas

@MistChristmas MistChristmas commented Aug 25, 2026

Copy link
Copy Markdown
Contributor

About the pull request

Both launch_atom and fire_at use get_line to pass up and down z levels.
This doesn't consider if something is in the way, or if the z levels are connected.

So add that to get_line, lord knows how anything else will react to that, so just limit it to the two cases above for now via an optional argument.

Basically what this does is find the cross over points where the atom is transitioning to the next z level. And make sure that we add the extra tile into consideration, and making sure it's an open_space rather than phasing through diagonally.

Resolves: #11904, Resolves: #13023

Explain why it's good for the game

Bugs bad. Phasing through stuff bad. Shooting xenos on the ground from the comfort of your CIC chair also bad.

Testing Photographs and Procedure

Screenshots & Videos

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

Changelog

🆑
code: Add an arugment to get_line to account for objects transitioning z levels. Currently used for throwing and shooting.
fix: Being able to throw people off the map on WARF. Being able to shoot xenos on the ground from CIC.
/:cl:

@MistChristmas MistChristmas changed the title Draft: Fix: Tossing things across Z levels better Add Multi-Z handling to get_line Aug 25, 2026
@MistChristmas
MistChristmas marked this pull request as ready for review August 25, 2026 18:17
@cmss13-ci cmss13-ci Bot added Code Improvement Make the code longer Fix Fix one bug, make ten more labels Aug 25, 2026
@cmss13-ci cmss13-ci Bot added the size/M Denotes a PR that changes 50-199 lines, ignoring generated files. label Aug 25, 2026
@cm13-github

cm13-github commented Aug 25, 2026

Copy link
Copy Markdown
Contributor

Test merge deployment history:

Test Merge Deployed @ 08/25/2026 22:53:59 +00:00:
Server Instance

CM13 Live

Revision

Origin: 5d90c41
Pull Request: 93c1896
Server: 353b07e

Test Merge Updated @ 08/26/2026 01:55:37 +00:00:
Server Instance

CM13 Live

Revision

Origin: 517b3b1
Pull Request: 93c1896
Server: 7bdd4cb10f12be69f30b9c7ba61b620178b66390

Test Merge Updated @ 08/26/2026 04:42:46 +00:00:
Server Instance

CM13 Live

Revision

Origin: 517b3b1
Pull Request: 93c1896
Server: a35719b

Test Merge Updated @ 08/26/2026 07:57:58 +00:00:
Server Instance

CM13 Live

Revision

Origin: 517b3b1
Pull Request: 93c1896
Server: a7c4a3a

Test Merge Updated @ 08/26/2026 18:34:17 +00:00:
Server Instance

CM13 Live

Revision

Origin: 517b3b1
Pull Request: 93c1896
Server: 22df5a5

Test Merge Updated @ 08/27/2026 01:03:51 +00:00:
Server Instance

CM13 Live

Revision

Origin: c3894cb
Pull Request: 93c1896
Server: d8c2f3c41896cc151c134adb9c6a9128db84a535

Test Merge Updated @ 08/27/2026 08:36:56 +00:00:
Server Instance

CM13 Live

Revision

Origin: d55f214
Pull Request: 93c1896
Server: 6da6a4354f77b6132867295f1505c15c050453b9

Test Merge Updated @ 08/27/2026 20:11:02 +00:00:
Server Instance

CM13 Live

Revision

Origin: acefcda
Pull Request: 93c1896
Server: fd80f2f8b1058df2cc4b507d84d814a54f75e3fe

Test Merge Updated @ 08/28/2026 02:43:33 +00:00:
Server Instance

CM13 Live

Revision

Origin: d87b77d
Pull Request: 93c1896
Server: 1b7400711b46d29d47c35d77b50fe30c9bd941fe

Test Merge Updated @ 08/28/2026 07:15:32 +00:00:
Server Instance

CM13 Live

Revision

Origin: bf948a9
Pull Request: 93c1896
Server: b3af38992b388bff6b64a7537ceb5d0dbb800853

Test Merge Updated @ 08/28/2026 07:46:23 +00:00:
Server Instance

CM13 Live

Revision

Origin: 560667c
Pull Request: 93c1896
Server: a6c0371e9379446bbec6a99d9d0f7e757f93d5ac

Test Merge Updated @ 08/28/2026 08:47:21 +00:00:
Server Instance

CM13 Live

Revision

Origin: e7bcec5
Pull Request: 93c1896
Server: f64ddea

Test Merge Updated @ 08/28/2026 09:18:11 +00:00:
Server Instance

CM13 Live

Revision

Origin: e7bcec5
Pull Request: 93c1896
Server: 062affd

Test Merge Updated @ 08/28/2026 10:49:19 +00:00:
Server Instance

CM13 Live

Revision

Origin: 426f900
Pull Request: 93c1896
Server: 66b6e09f475df1522efefeb05d237dab7ba4b85a

Test Merge Updated @ 08/28/2026 13:50:54 +00:00:
Server Instance

CM13 Live

Revision

Origin: 426f900
Pull Request: 7dee321
Server: 43f790a

Test Merge Updated @ 08/28/2026 17:20:20 +00:00:
Server Instance

CM13 Live

Revision

Origin: 426f900
Pull Request: 7dee321
Server: c9195c6

Test Merge Updated @ 08/29/2026 03:25:11 +00:00:
Server Instance

CM13 Live

Revision

Origin: 426f900
Pull Request: 7dee321
Server: 8ae42ab

Test Merge Updated @ 08/29/2026 03:35:57 +00:00:
Server Instance

CM13 Live

Revision

Origin: 426f900
Pull Request: 7dee321
Server: 100914b

Test Merge Updated @ 08/29/2026 03:56:04 +00:00:
Server Instance

CM13 Live

Revision

Origin: af5b429
Pull Request: 7dee321
Server: 8c28ae70b3709e60256d1fafa9ec1a5c66a36145

Test Merge Updated @ 08/29/2026 05:57:17 +00:00:
Server Instance

CM13 Live

Revision

Origin: af5b429
Pull Request: 7dee321
Server: c4ff711

Test Merge Updated @ 08/29/2026 06:28:08 +00:00:
Server Instance

CM13 Live

Revision

Origin: 0e026b2
Pull Request: 7dee321
Server: 409c9088caafe5ea779f3da4aa79d44647024b28

Test Merge Updated @ 08/29/2026 06:58:59 +00:00:
Server Instance

CM13 Live

Revision

Origin: 309b015
Pull Request: 7dee321
Server: 5f3c349c51a4804e928e4dad4b99b4de757663fa

Test Merge Updated @ 08/29/2026 07:35:09 +00:00:
Server Instance

CM13 Live

Revision

Origin: 7d3e722
Pull Request: 7dee321
Server: 4ae4556

Test Merge Updated @ 08/29/2026 12:02:42 +00:00:
Server Instance

CM13 Live

Revision

Origin: 89fbf14
Pull Request: 7dee321
Server: 87a72b1

Test Merge Updated @ 08/29/2026 15:14:44 +00:00:
Server Instance

CM13 Live

Revision

Origin: 89fbf14
Pull Request: 7dee321
Server: 31da47f

Test Merge Updated @ 08/29/2026 16:01:51 +00:00:
Server Instance

CM13 Live

Revision

Origin: 407574d
Pull Request: 7dee321
Server: ddc8aee0fc51131ebc595c8599de85adab6bfbcb

Test Merge Updated @ 08/29/2026 19:02:09 +00:00:
Server Instance

CM13 Live

Revision

Origin: 407574d
Pull Request: 7dee321
Server: 8c1676d

Test Merge Updated @ 08/29/2026 22:34:01 +00:00:
Server Instance

CM13 Live

Revision

Origin: 407574d
Pull Request: 7dee321
Server: 48b2cee

Test Merge Updated @ 08/30/2026 04:36:09 +00:00:
Server Instance

CM13 Live

Revision

Origin: aadc18b
Pull Request: 7dee321
Server: 8e94f7a3a5bcfbe07e7220dc6bbee98a076fd780

Test Merge Updated @ 08/30/2026 08:07:48 +00:00:
Server Instance

CM13 Live

Revision

Origin: aadc18b
Pull Request: 7dee321
Server: 940d7d8

Test Merge Updated @ 08/30/2026 08:38:40 +00:00:
Server Instance

CM13 Live

Revision

Origin: e38bed0
Pull Request: 7dee321
Server: c1815777d1e9fd7a3cbaf16b6d75e9c7932a2a6a

Test Merge Updated @ 08/30/2026 10:39:52 +00:00:
Server Instance

CM13 Live

Revision

Origin: e38bed0
Pull Request: 7dee321
Server: 34077b0

Test Merge Updated @ 08/30/2026 11:54:14 +00:00:
Server Instance

CM13 Live

Revision

Origin: e38bed0
Pull Request: 7dee321
Server: 3e015f1

Test Merge Updated @ 08/30/2026 16:22:23 +00:00:
Server Instance

CM13 Live

Revision

Origin: e38bed0
Pull Request: 7dee321
Server: 0ef67b6

Test Merge Updated @ 08/31/2026 02:14:25 +00:00:
Server Instance

CM13 Live

Revision

Origin: 6bc71d6
Pull Request: 7dee321
Server: 056666907d33109d4356a657e75ca47aefce21f5

Test Merge Updated @ 08/31/2026 04:15:42 +00:00:
Server Instance

CM13 Live

Revision

Origin: 2ecc25f
Pull Request: 7dee321
Server: 44b1cba7eb55734d1ce18837a6e82d37ed0d2069

Test Merge Updated @ 08/31/2026 04:25:38 +00:00:
Server Instance

CM13 Live

Revision

Origin: 2ecc25f
Pull Request: 7dee321
Server: 896ea40

Test Merge Updated @ 08/31/2026 04:46:33 +00:00:
Server Instance

CM13 Live

Revision

Origin: b004c65
Pull Request: 7dee321
Server: 2542b25360c45eaead169314848c6f986765c325

Test Merge Updated @ 08/31/2026 05:54:24 +00:00:
Server Instance

CM13 Live

Revision

Origin: b004c65
Pull Request: 7dee321
Server: 620d162

Test Merge Updated @ 09/01/2026 22:01:17 +00:00:
Server Instance

CM13 Live

Revision

Origin: 313de72
Pull Request: 7dee321
Server: 6422b5d

Test Merge Updated @ 09/02/2026 02:33:09 +00:00:
Server Instance

CM13 Live

Revision

Origin: 47354be
Pull Request: 7dee321
Server: 12041743c5ebe664b582e3fdd53340c1c346ef81

Test Merge Updated @ 09/02/2026 04:04:18 +00:00:
Server Instance

CM13 Live

Revision

Origin: c12d521
Pull Request: 7dee321
Server: 87b019f84ce11b693b9dd6ad331987cdab27dc3e

Test Merge Updated @ 09/02/2026 07:05:37 +00:00:
Server Instance

CM13 Live

Revision

Origin: f74475d
Pull Request: 7dee321
Server: d0d79e90154b54edeaa9b46a9b617a3f6605276c

Test Merge Updated @ 09/02/2026 08:06:33 +00:00:
Server Instance

CM13 Live

Revision

Origin: 9d0564e
Pull Request: 7dee321
Server: d5e7e0651cee8f6ffbf63f9db2606d3428726179

Test Merge Updated @ 09/02/2026 20:40:02 +00:00:
Server Instance

CM13 Live

Revision

Origin: 9d0564e
Pull Request: 7dee321
Server: 6be6a07

Test Merge Updated @ 09/02/2026 21:10:56 +00:00:
Server Instance

CM13 Live

Revision

Origin: 1ab3353
Pull Request: 7dee321
Server: 20b6886328d909633b50246644626a4ca75cc7ea

Comment on lines +1377 to +1378
if(!istype(switching_cross_point, /turf/open_space))
line.Cut(max(1, mutli_z_cross_points[crossing_point] + 1), length(line) + 1) //Hit a non open_space turf. Shouldn't go through anything else. Stop here.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Kinda the whole point. We shorten the line to the actual traversable tiles. We can't go any further because there is not an open_space that lets us do so.

So this stops get_line traversing Zs where it shouldn't be doing it. Because there's a tile to block it.

fira
fira previously approved these changes Aug 28, 2026
@github-project-automation github-project-automation Bot moved this from Awaiting Review to Partially Approved / Mergeable in Review Backlog Aug 28, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Code Improvement Make the code longer Fix Fix one bug, make ten more size/M Denotes a PR that changes 50-199 lines, ignoring generated files.

Projects

Status: Partially Approved / Mergeable

3 participants