Open DarthFutuza opened 2 years ago
My initial thought with fixing this is, we could probably do something similar to CG_LoadClientInfo() and force it reload a default model so that the whole skin is refreshed. You'll notice you can 'fix' the issue, by changing your model to a different one (due to the warzone stuff you'll have to select one allowed by the team eg: red ugnaught instead of regular ugnaught). It appears that only the visuals for armor are not getting turned off, but they do if the model is changed.
Strangely doing map_restart is not affected by this, (unless the ghost armor has previously been generated by an earlier timelimit triggered restart). This only happens if timelimit is hit. I don't really see much of a difference between the way the two restart methods behave, they call nearly all the same functions and should be basically identical. (Obviously there's something I'm missing).
I tried to investigate what happens if you try to iterate through each entities inventory from within G_ShutdownGame(), and unequip all items as well as clear out the inventory. This doesn't seem to have any effect at all though. The ghost armor will remain behind regardless.
Missing something obvious, I don't really understand ghoul2 and that's probably where the problem is.
Partially addressed by 02cad80 this is a silly workaround but fixes the problem.
If a player equips armor during a match, when the timelimit is reached and the match restarts on the same map (no map cycle), the armor will visually remain (though it isn't quite right either). Instead of clearing out. This does not happen if the map is changed or SV_MapRestart_f() ends up calling SV_SpawnServer() (ie: the gametype or maxclients are modified).
To reproduce do the following:
devmap jkg_ctf_bespin
timelimit 1
give item helmet_stormtrooper
Example Video: https://www.youtube.com/watch?v=pJSNGy78dl8