Skip to content

Fix phantoms not dying when shot during the "birth" state animation - #771

Merged
themrdemonized merged 2 commits into
themrdemonized:prfrom
lulnope:bugfix/phantoms-do-not-die-when-shot-at-birth
Oct 20, 2026
Merged

themrdemonized merged 2 commits into
themrdemonized:prfrom
lulnope:bugfix/phantoms-do-not-die-when-shot-at-birth

Conversation

@lulnope

@lulnope lulnope commented Oct 19, 2026 •

Copy link
Copy Markdown
Contributor

This fixes the well known bug that keeps phantoms flying around and through the player.

Thanks to Jack_Harris in GAMMA discord for providing info on repro:

  • shoot phantom while it is in the initial animation
  • now the phantom does not "die" when it comes in contact with the player

The root cause is the lines 306 and 241 in phantom.cpp, they respectively:

  • 306: transition phantom into "stShoot" state ONLY when phantom is currently in "stFly", so if phantom is "stBirth" then it does not die on hit. Hit damage however still makes phantom to be g_Alive() == false
  • 241: check that player gets hit by phantom ONLY if g_Alive() == true, so a phantom that got hit during stBirth will never "self-destroy" on player contact and has to be hit again to be destroyed despite being "dead" according to the game.

The fix:
after stBirth animation finishes check if phantom is dead. If it's dead then transition to stShoot, if it's alive then continue to stFly as it did before the change.

Shitty 480p video proof (under 10mb limit for attachments...). Note that since we wait for the stBirth animation to end there might be a delay between phantom getting shot and it "dying" - this is noticeable in the video.

2026-10-19.20-44-42.mp4

@damoldavskiy

Copy link
Copy Markdown
Contributor

LGTM

@themrdemonized

Copy link
Copy Markdown
Owner

Looks kinda janky. We need to decide if its appropriate to do either of these:

  • When phantom is in birth state, its immune to damage, only can be killed when its in flying state
  • Instant transition to dying state or particle puff skipping dying animation

@lulnope

lulnope commented Oct 19, 2026 •

Copy link
Copy Markdown
Contributor Author

I pushed a second commit to the same branch with alternative version of the fix. This attempt makes it possible for phantoms in stBirth to transition straight to stShoot upon being hit.

I chose the initial approach because I have no idea how animations work and I expected the "clean" approach of doing something only in "animation end" callback was safer. The game did not crash for me with this new approach so I guess I was unnecessarily careful there.

Video proof, note that phantoms now disappear immediately upon being hit despite being in stBirth state:

2026-10-19.23-56-37.mp4

Snarky comment: I know no one begged for the fix, but damn if you're not being choosers : )

@erepb

erepb commented Oct 19, 2026

Copy link
Copy Markdown
Contributor

actually i think a lot were begging for a fix. these bugged bastards are extremely annoying

@themrdemonized
themrdemonized changed the base branch from all-in-one-vs2022-wpo to pr October 20, 2026 02:45
@themrdemonized
themrdemonized merged commit e4b7ce2 into themrdemonized:pr Oct 20, 2026
17 of 18 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.

4 participants