Closed d-bind closed 3 months ago
With "boom weapon auto switch" disabled (dsda_switch_when_ammo_runs_out 0), the effect can be consistently replicated by firing (not REfiring) the last two shells from attached custom SSG. No precise timing or autoswitching from another weapon needed in this case. deh_ssg.zip
This is a bummer. Do we have a solution to this @kraflab ?
I haven't looked into it at all, but it's going to require a new comp flag to fix.
This seems like an issue very similar to what was described in this PRBoom+ Issue https://github.com/coelckers/prboom-plus/issues/131
Apparently this fixed it. https://github.com/coelckers/prboom-plus/commit/febe0e16b855b9f893be2268e782596edb984509
looking at the history, that line was removed here https://github.com/kraflab/dsda-doom/commit/52b4365ba4a283ef60e8cf78ade87fbdcff4b07c#comments I have no idea if adding it back is the correct answer though.
Couple of observations:
A_CheckReload
has no behavior indicating that a new weapon should be selected.P_CheckAmmo
, is that player->pendingweapon
isn't directed to anything to switch to unless demo_compatibility
is true. Adding player->pendingweapon = P_SwitchWeaponMBF21(player);
or player->pendingweapon = P_SwitchWeapon(player);
. Since P_SwitchWeapon
calls P_SwitchWeaponMBF21
if the complevel is 21 anyway, we can probably just stick the latter in there.The issue shown in the demos posted seems related to the fact that chaining multiple weapon swaps never leaves things in an "off" state for the check "have i done a weapon autoswitch already?" to reset, meaning the second time (when using the last shells), the game thinks the autoswitch already happened and thus never bothers to set the new weapon. I think that could be fixed by resetting the autoswitch check inside A_CheckReload, at least I wasn't able to trigger the bug with that change. But that doesn't affect the dehacked ssg issue, that even still happens if I delete the code in A_CheckReload that messes with weapon state. I'm not sure exactly why it still lowers the weapon in that case.
There is some probably related code commented out in the original MBF sources:
Adopting this suggestion from @fabiangreffrath: https://github.com/kraflab/dsda-doom/commit/fb53471fae5aed6b780894c0a126cd073b4f87c1 The auto switch logic can be improved separately, for now this fixes the critical outcome.
If the last two shells are fired immediately after automatically switching to SSG, the weapons will disappear, and it becomes impossible to switch to any weapon, either manually or by picking them up. Also Doomguy gets stuck with an angry face.
Lasts until respawn and persists across level transitions, though the face does get fixed. The SSG has to be fired right after switching to it, but not by holding the fire button, so the timing is tricky.
Error log shows "P_BringUpWeapon: weaponinfo overrun has occurred."
Only happens in complevel 21. In cl 11, the same actions lead to the SSG staying up with 0 shells, but switching manually is possible, and attempting to fire will switch automatically. Happens in 0.27.1 and 0.24.0. Can't seem to trigger in 0.23 or 0.22, but it still happens when playing demos from later versions. When played back in other ports, the demos crash the game.
Demos