fix: win condition on frag + suicide#74
Conversation
cdb7ca1 to
9cbf4e6
Compare
ec-
left a comment
There was a problem hiding this comment.
Please, NEVER change physical location of vmMain(): it MUST be the very first function compiled into the .qvm file as it said in original comment.
Use proper forward declarations instead.
9cbf4e6 to
da78b0e
Compare
|
I missed that, good point. Fixed now I think. |
|
Sorry, I miss the point for a moment, but also, please avoid such things in general: f8582a1 |
I didn't know that, interesting. |
|
Ah, I think I can just make the function have 1 return. I'll do that tomorrow. |
|
Personally I don't think you're saving any real measurable difference with adding the run command extra function call over having the switch. Even in qvm compared to native there will be very little improvement |
da78b0e to
37916aa
Compare
|
Sorry, @ensiform I'm not sure what you mean? Regarding |
|
This refactor doesn't really belong in the same pr as the other change IMHO. What does this change actually add? |
How would I ensure to do |
37916aa to
d4956d3
Compare
|
Why does that suddenly need to be called at the end of the vmmain? CheckExitRules typically runs on per frame basis. Calling it whenever vmMain is invoked for one of the limited vm_calls seems extremely unnecessary as opposed to during runframe already because that's the only one which fires often. I don't see how it fixes the problem when you're just calling it multiple times per frame then. |
|
In vanilla (and current main) Perhaps I'll need to adjust commit message to clarify this. |
|
I'm confused because you already fixed that in the other commit allegedly from etlegacy similar message? |
|
Yes, I submitted that first but then came up with this supposedly better solution, which also fixes the bug for the railgun, the shotgun and everything. See MR description. |
Compared to https://github.com/ec-/baseq3a/pull/73 this is a more general and robust fix, also affecting railgun, shotgun, direct missile hits, and telefrags. Note that `G_RunFrame` still calls `CheckExitRules()` directly, which probably makes sense, to keep things as is there. Related: - etlegacy/etlegacy#2051.
d4956d3 to
a2c30aa
Compare
This is the inconsistent behavior in question:
splash-damage-win-inconsistency.mp4
With the fix:
fix-win-condition-last-frag.mp4
(if you're wondering about the "teams are tied" announcement:
it's not about this MR. It's also reproducible in vanilla,
if you shoot first a teammate then an enemy with the railgun).
Compared to #73
this is a more general and robust fix,
also affecting railgun, shotgun, direct missile hits,
and telefrags.
Basically this ensures that weapon behavior does not differ
depending on whether there is 1 frag left or not.
That is, a railgun kills two players if they're aligned,
a rocket kills everyone who's in splash radius, etc.
I actually started working on this before #73 got merged,
but unfortunately I didn't mark it as draft in time.
So when/if this MR gets merged, that one
is basically not needed anymore and can be reverted for simplicity.
Or maybe the consistency is nice anyway,
at least for the order of log messages,
so only the comment needs to be adjusted at least.
Note that
G_RunFramestill callsCheckExitRules()directly,which probably makes sense, to keep things as is there.
Related: