Skip to content

deploy follow fixes#10

Open
KascadeKyle wants to merge 1 commit intoclockworklabs:masterfrom
KascadeKyle:fix-deploy-follow
Open

deploy follow fixes#10
KascadeKyle wants to merge 1 commit intoclockworklabs:masterfrom
KascadeKyle:fix-deploy-follow

Conversation

@KascadeKyle
Copy link

@KascadeKyle KascadeKyle commented Feb 27, 2026

Summary

This PR strengthens validation in deployable_follow to prevent invalid or client-manipulated move requests.

Changes

  • Added proximity sanity check (MAX_PROXIMITY_DISTANCE)

    • Rather than just checking if mobile_state exists for the deployable, fetch the coordinates and use it in our validation.
    • Require the following to all be in the same dimension and within a bounded distance of each other:
      • Player location (server)
      • Deployable location (server)
      • Client-provided origin
      • Client-provided destination
    • Helps prevent client coordinate spoofing or inconsistent move requests.
  • Fixed water-depth validation logic

    • Previously rejected only when both start and target were invalid (&&).
    • This allowed moves where one endpoint was invalid (e.g., land → water or water → land).
    • Now ensures start, target, and the deployable’s authoritative location all satisfy pathfinding water-depth constraints.
  • Removed misleading copied comment

    • Removed the comment:
      // Validate Boat Move. Note that this for the short term, ideally at some point
      // we will re-enable the above _validate_move that has more comprehensive checks
    • This comment was copied from BitCraftServer\packages\game\src\game\handlers\player\deployable_move.rs and was misleading here (the reducer does not deal with boats).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant