Skip to content

Expose NPC vehicle lifecycle events - #267

Merged
ifBars merged 3 commits into
stablefrom
diffuin/243-29624926
Aug 14, 2026
Merged

Expose NPC vehicle lifecycle events#267
ifBars merged 3 commits into
stablefrom
diffuin/243-29624926

Conversation

@diffuin

@diffuin diffuin Bot commented Aug 13, 2026

Copy link
Copy Markdown

Summary

  • Exposes NPC.OnEnterVehicle and NPC.OnExitVehicle with managed LandVehicle arguments.
  • Subscribes each mod handler directly to the corresponding native NPC delegate through a retained Mono/IL2CPP bridge.
  • Removes the exact native registration on event removal and cleans remaining registrations during NPC destruction or scene reset.
  • Lazily initializes registration state so joined-client wrappers created without constructors remain supported.

Validation

  • MonoMelon full suite: 578 passed.
  • Il2CppMelon full suite: 567 passed.
  • Mono gameplay smoke: passed in Main against head c3e9771.
  • IL2CPP gameplay smoke: passed in Main against head c3e9771.
  • Runtime probe verified native enter/exit delivery, managed vehicle conversion, duplicate registration, one-at-a-time removal, final unsubscription, and throwing-subscriber isolation.
  • git diff --check passed.

Closes #243

@ifBars
ifBars merged commit 0954874 into stable Aug 14, 2026
6 checks passed
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.

[FEATURE] Expose NPC vehicle entry and exit events

1 participant