Repository navigation
Conversation
6 of 12 tasks
Member
|
related #470 |
The hull of a ship is made of impassable pieces, so CanSeeLOS between a char on the deck and a char in the water was always blocked: sea monsters never attacked the sailors, and the sailors couldn't target them. The same between the crews of two ships (Sphereserver#470). The pieces of the ships the two are on don't block the line of sight anymore (and on a tall piece, like a mast, the walk keeps its height). Even with the line of sight, a swimming creature can't get adjacent to who stands on the deck, and the other way round. Fight_CalcRange gets the target: when one of the two is on a ship and the other is an NPC able to swim outside of it, the reach is at least 3 tiles. Co-Authored-By: Claude Opus 5.5 <[email protected]>
DavideRei
force-pushed
the
fix/ship-sea-los-and-range
branch
from
November 29, 2026 09:06
baac4fd to
23797e4
Compare
Contributor
Author
|
Yes, it's the same problem. This PR fixed the line of sight between a ship and the sea in the old LOS (as noted in #470, AdvancedLos already let it through), but between two ships only the pieces of the attacker's ship were skipped, so the hull of the other ship still blocked. Now the pieces of both ships are skipped, so it fixes #470 too. COMBAT_ALLOWHITFROMSHIP is still needed to attack from a ship, as before. I added a test script to the description ( |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
The hull of a ship is made of impassable pieces, so CanSeeLOS between a char on the deck and a char in the water was always blocked: sea monsters never attacked the sailors, and the sailors couldn't target them. The same between the crews of two ships, with spells and ranged weapons (#470). The pieces of the ships the two are on don't block the line of sight anymore (and on a tall piece, like a mast, the walk keeps its height).
Even with the line of sight, a swimming creature can't get adjacent to who stands on the deck, and the other way round. Fight_CalcRange gets the target: when one of the two is on a ship and the other is an NPC able to swim outside of it, the reach is at least 3 tiles.
Type of Change
Related Issues
Fixes #470 (attacking from a ship still needs COMBAT_ALLOWHITFROMSHIP, as before).
Testing
pr_test_1632.scp), run with and without this PR on a test shard: 5 PASS with the PR; on current dev the 3[BUG]tests FAIL and the 2[SANITY]ones pass.Checklist
Additional Notes
If #1631 (floors line of sight) is merged too, its check should skip the pieces of the ship (fShipPiece).
Test script, in the same format as the
pr_test.scpof #1627: run.pt_run_allas a GM, anywhere. It uses an NPC (GMs see through everything outside of a fight) and the old line of sight (AdvancedLos=0 for NPCs). Two small ships are created side by side in open water found on map 0, and removed at the end.pr_test_1632.scp
🤖 Generated with Claude Code