Clonecop bossfight linux softlock fix - #362
Open
micr0-dev wants to merge 2 commits into
Open
Conversation
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.
haii!! I was playing through Entropy: Zero 2 for the first time on native Linux and absolutely loving it, right up until the Clone Cop boss fight at the end of
ez2_c6_1, where the game crashed the moment I landed my first shot on him. Turns out a few other Linux players have hit the same wall (https://www.reddit.com/r/HalfLife/comments/1sgaghu/entropy_zero_2_bug/). The usual workaround is to switch to Proton, which does let you finish the fight, but older Source runs pretty rough under Proton, so it wasn't great even though I did beat the game that way. So I dug in to fix it properly. This PR sorts out two separate Linux-only (GCC) bugs in that fight that don't show up on Windows/Proton.The crash when you first damage Clone Cop
Clone Cop is meant to only use gesture flinches, so
GetFlinchActivityreturnsACT_INVALIDfor the non-gesture case, but the small/big flinch tasks passed that straight intoSetIdealActivitywithout checking it. On Linux/GCC that ends up feeding an invalid sequence into the animation system and segfaults the server; Windows/MSVC just happens to tolerate it. This was the actual cause of the "Linux softlock" others and I was running into. The fix mirrors theHaveSequenceForActivityguard the gesture-flinch path already uses a bit further down in the same file.The
index 'ragdoll' does not existerrorsWhile I was in there I also hit a second Linux-only(?) issue: the boss respawn can create a ragdoll with a null script instance, and the
OnServerRagdollhook sites passed that through unguarded, which left the hook'sragdollparameter undefined on GCC and broke the script's warp effect. Guarded both sites so a valid value always gets passed.Repro: native Linux build, go into any chapter first via the menu (entities break otherwise),
changelevel ez2_c6_1, reach the fight, fire one shot at clonecop and the server crashes. I verified the fix by building the Linux server through this repo's CI on my fork and swapping in server.so and client.so. and the fight now plays through cleanly start to finish, and the mid-fight autosave loads fine too. (since i died while testing this xD)Anyway, thanks for making such an awesome mod!! it was a blast to play. In case this gets merged and you'd want to credit me, I go by micr0byte (micr0-dev here on GitHub).
Does this PR close any issues?
PR Checklist
developbranch OR targets another branch with a specific goal in mind