Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[HL2] npc_combinedropship with a strider crate type crashes on spawn #676

Open
Blixibon opened this issue Feb 19, 2025 · 0 comments
Open

Comments

@Blixibon
Copy link

Describe the bug

A npc_combinedropship entity with its CrateType keyvalue set to CRATE_STRIDER causes an access violation on spawn due to an invalid model pointer. This is on the latest version of the Source 2013 master branch.

Steps to reproduce

Steps to reproduce the behavior:

  1. Load a map with a dropship carrying a strider crate, or create a dropship entity with this crate type manually by using the following command: ent_create npc_combinedropship CrateType -1
  2. Game will crash due to the dropship having an invalid model pointer while setting up the strider's bones, specifically while the strider is executing MoveToGround.

Expected behavior

npc_combinedropship should be able to use this crate type without crashing the game. Half-Life 2 itself uses dropships with the strider crate type in d3_c17_04, d3_c17_05, d3_c17_09, d3_c17_11, and d3_c17_13.


Additional context

This seems to be related to SetModel being moved from before to after m_hContainer is created (#L977) in the recent commit. Moving it back to before the container is spawned fixes the issue. Alternatively, moving the SetParent() call on the strider (#L905) to after its Spawn() call also seems to fix the issue, as the strider no longer requires the dropship's model pointer.

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

No branches or pull requests

1 participant