Skip to content

Fix vehicle unseating on region crossings by ignoring outgoing sim kills - #398

Open
Shadowolf7 wants to merge 1 commit into
AlchemyViewer:developfrom
Shadowolf7:upstream-alchemy-vehicle-fix
Open

Shadowolf7 wants to merge 1 commit into
AlchemyViewer:developfrom
Shadowolf7:upstream-alchemy-vehicle-fix

Conversation

@Shadowolf7

Copy link
Copy Markdown
Contributor

Problem

During region crossings, an avatar can be unexpectedly unseated from their vehicle or seat. This occurs when the departing (outgoing) simulator sends a KillObject message for the vehicle while the handoff to the new simulator is still in progress. The viewer processes this kill and calls markDead(), which forces the avatar to stand up before the new region has taken full ownership.

Solution

  • In process_kill_object, check if a KillObject packet originates from a non-active region (regionp != gAgent.getRegion()) while the avatar is seated on the object or its linkset.
  • When detected, ignore the kill from the departing simulator so the vehicle remains alive during the crossing handoff.
  • Cache objectp->getRootEdit() in a local pointer to avoid redundant tree traversals.
  • Only log (LL_INFOS) when the linkset root prim is targeted, preventing log spam for complex multi-prim linksets.

@coderabbitai

coderabbitai Bot commented Sep 11, 2026

Copy link
Copy Markdown
Contributor

Review Change StackReview Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Advanced

Run ID: a2b41d2e-547c-42c3-a58c-f68b665abc05

📥 Commits

Reviewing files that changed from the base of the PR and between 3c8cb82 and 82c4a2f.

📒 Files selected for processing (1)
  • indra/newview/llviewermessage.cpp

Included review availability: Your plan provides up to 1 included review per hour; 0 remain after this review.


📝 Summary

Summary by CodeRabbit

  • Bug Fixes
    • Prevented agents from being unexpectedly unseated when crossing regions while sitting on a vehicle or seat.
    • Preserved the seated vehicle and its associated seat objects when receiving cross-region object removal updates.

Walkthrough

The change updates process_kill_object to ignore cross-region kill messages for the vehicle or seat object on which the agent is sitting.

Changes

Seated object protection

Layer / File(s) Summary
Cross-region kill guard
indra/newview/llviewermessage.cpp
process_kill_object skips matching seated root and child seat objects when a kill message comes from another region. It logs the skipped root object.

Priority: ➖ Normal

Estimated code review effort: 2 (Simple) | ~10 minutes

Change: Bug fix · Severity of issue fixed: Medium

Merge Risk: ⚪ Minimal · up to 82c4a

The cross-region seated-object protection change has no unresolved merge-blocking risk.

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 1 functions across 1 files. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly and concisely identifies the main fix: preventing vehicle unseating during region crossings by ignoring outgoing simulator kill messages.
Description check ✅ Passed The description clearly explains the problem and solution, including the affected function and key implementation details. It does not include a related issue link or the checklist responses, but the …
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
  • Fix all pre-merge checks with AI

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

A rabbit guards the vehicle seat,
When crossing winds make regions meet.
The root stays firm, the child stays near,
No stray kill message brings fear.
Safe in transit, the ride goes on.

Comment @coderabbitai help to get the list of available commands.

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant