Added WorldHitscanFired and WorldHitscanPreFired#2432
Merged
madame-rachelle merged 2 commits intoZDoom:masterfrom Nov 20, 2024
Merged
Added WorldHitscanFired and WorldHitscanPreFired#2432madame-rachelle merged 2 commits intoZDoom:masterfrom
madame-rachelle merged 2 commits intoZDoom:masterfrom
Conversation
Collaborator
|
Yeah it's hard to pin down the issue with this code since it trips up something else entirely within the new file system. |
Contributor
|
Report it as a bug. If anything, Graf can take a look at it. |
Contributor
Author
That's what I'm doing, more or less? I can't really report it as a bug for the current version of GZDoom because this issue occurs only after my personal changes on the cpp side. |
Boondorl
reviewed
Aug 18, 2024
Boondorl
suggested changes
Aug 18, 2024
Contributor
Author
|
This is finally fixed and tested. No performance impact that I could see. |
Contributor
Author
|
Replaced |
tiltshiftfocus
pushed a commit
to tiltshiftfocus/gzdoom
that referenced
this pull request
Apr 22, 2025
* Added WorldHitscan events * DVector3 → const DVector3&
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This adds
WorldHitscanFiredandWorldHitscanPreFiredevents toP_LineAttackandP_RailAttack. The former is called after a hitscan has been fired and provides information about it; the latter before it and allows stopping it. The idea is to allow mod authors universally detect hitscans, and potentially replace them with projectiles, which hasn't been possible so far.THE PROBLEM is that in its current form, despite compiling properly, it leads to a mysterious crash on startup, presumably tripping up the file system. This is caused by WorldHitscanPrefired specifically; the other features were tested and work fine, but as soon as I added WorldHitscanPrefired, the crashes started happening. Unfortunately, I cannot nail down the issue myself.UPD: I can't believe my inattention; the whole problem was that WorldHitscanPreFired was defined without a return value in zscript, and apparently that causes a CTD on startup rather than a build error.
Test file. This replaces hitscans with plasma balls and reports on received values.
WorldHitscan.zip