Skip to content

Guard spawned entity failure paths - #3306

Merged
FPtje merged 1 commit into
FPtje:masterfrom
ShiroKSH:fix/spawned-entity-guards
Jul 13, 2026
Merged

Guard spawned entity failure paths#3306
FPtje merged 1 commit into
FPtje:masterfrom
ShiroKSH:fix/spawned-entity-guards

Conversation

@ShiroKSH

@ShiroKSH ShiroKSH commented Jul 8, 2026

Copy link
Copy Markdown
Contributor

Summary

  • validate spawned weapon/shipment entities before writing fields or placing them
  • guard physics wake/mass calls when physics initialization fails
  • preserve the original spawned weapon state when /makeshipment cannot create a crate
  • skip delayed money printer explosions after the printer has already been removed
  • avoid touching food owner counters after the owner entity is gone

Why

These paths mostly depend on configurable entity classes/models. When creation or physics initialization fails, the code could continue into method calls on invalid entities or physics objects. The changes keep the normal success path the same and bail out earlier on failed creation paths.

Checks

  • git diff --check
  • .github/scripts/check-modified-subtree.sh

@ShiroKSH
ShiroKSH marked this pull request as ready for review July 8, 2026 18:07

@FPtje FPtje left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM! Will run one last test on these PRs, running them against my gmod instance before merging 👍

@FPtje
FPtje merged commit 5f9796a into FPtje:master Jul 13, 2026
2 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.

2 participants