MantisBT - Zandronum
View Issue Details
0001608Zandronum[All Projects] Bugpublic2013-12-08 21:022022-10-14 03:54
TerminusEst13 
Dusk 
normalminoralways
closedduplicate 
MicrosoftWindowsXP/Vista/7
1.2 
 
0001608: Swapping player classes on Unloading/Intermission screen does not reset inventory.
When changing class via Player Setup, you're supposed to lose all your inventory and start afresh with new stuff, right?
When done between maps on the Unloading screen, it...doesn't. So you spawn as the new class with the old inventory intact.

This is especially a pain in the ass for class-based mods (like Samsara) because it spawns you as the class with all the visual enhancements (new hud, sprites, sounds) and stats (damagefactors/resistances/etc), but the weapons and items from the previous class are still in your arsenal. So you can play as Parias with his massive explosive resistance and speed while using Duke Nukem's explosive-heavy arsenal.
1: Load class mod online (Like Samsara :D :D)
2: Go play a level with one class, pick up weapons and stuff
3: On intermission screen, go to Player Setup and change to another class before the next level loads.
4: If you're (un)lucky, you'll spawn in the next level with your new class using the old class' weapons.
verified by Dusk, screenshot is his
No tags attached.
duplicate of 0001313resolved Kaminsky PlayerClass desync/incorrect weapon when changing maps in co-op 
png Screenshot_Doom_20131208_214634.png (77,682) 2013-12-08 21:02
https://zandronum.com/tracker/file_download.php?file_id=1115&type=bug
png
Issue History
2013-12-08 21:02TerminusEst13New Issue
2013-12-08 21:02TerminusEst13File Added: Screenshot_Doom_20131208_214634.png
2013-12-08 21:02DuskAssigned To => Dusk
2013-12-08 21:02DuskStatusnew => assigned
2013-12-08 21:03DuskReproducibilitysometimes => always
2013-12-08 21:38DuskNote Added: 0007689
2013-12-15 20:32Torr SamahoNote Added: 0007700
2019-06-04 21:54DuskStatusassigned => new
2022-10-14 03:54WaTaKiDRelationship addedduplicate of 0001313
2022-10-14 03:54WaTaKiDStatusnew => closed
2022-10-14 03:54WaTaKiDResolutionopen => duplicate

Notes
(0007689)
Dusk   
2013-12-08 21:38   
It seems there was a workaround to preventing this from happening. p_mobj.cpp:4746:

// [BB] The (p->userinfo.PlayerClass != p->CurrentPlayerClass) check allows the player to change its class when respawning.
// We have to make sure though that the class is not changed when traveling from one map to the next, because a travelling
// player gets its inventory from the last map (which of course belongs to the previous class) after being spawned completely.


It seems the player class isn't supposed to change over map changes but it does. I don't really know how to handle this. What exactly are these PST_* constants? First thing that comes to my mind would be something like


if( p->playerstate == PST_LIVE )
{ p->p->userinfo.PlayerClass = p->CurrentPlayerClass;
    p->cls = PlayerClasses[p->CurrentPlayerClass].Type;
}
(0007700)
Torr Samaho   
2013-12-15 20:32   
For the sake of completeness, here are some comments on what the PST_* constants are meant to do:

[21:11:30] <Torr_Samaho> PST_LIVE and PST_DEAD are the common ones and should be more or less self explanatory.
[21:12:12] <Torr_Samaho> The other four describe intermediate states that will be taken care of when the player is spawned.
[21:13:06] <Torr_Samaho> For instance the state PST_ENTER means that the player just entered the game and will trigger enter scripts when spawned.
[21:14:12] <Torr_Samaho> PST_REBORN is similar. The player is meant to respawn and will get his inventory depending on the game mode.
[21:14:48] <Torr_Samaho> PST_REBORNNOINVENTORY and PST_ENTERNOINVENTORY are variants of the PST_REBORN and PST_ENTER.
[21:15:07] <Torr_Samaho> Script handling is the same, but the player will get no inventory when spawned.
[21:15:24] <Torr_Samaho> In all cases the state changes to PST_LIVE when the spawning is completed.