demoth / jake2

Quake 2 java port
GNU General Public License v2.0
59 stars 9 forks source link

Cannot change game `cvar` #98

Open demoth opened 1 year ago

demoth commented 1 year ago

after changing this cvar (which is "latched"), loading a new map gives a ConcurrentModificationException:

Exception in thread "main" java.util.ConcurrentModificationException
at java.base/java.util.HashMap$HashIterator.nextNode(HashMap.java:1493)
at java.base/java.util.HashMap$ValueIterator.next(HashMap.java:1521)
at jake2.qcommon.exec.Cvar.updateLatchedVars(Cvar.java:358)
at jake2.server.SV_MAIN.initializeServerCvars(SV_MAIN.java:1068)
at jake2.server.SV_MAIN.SV_Map_f(SV_MAIN.java:1413)
at jake2.qcommon.exec.Cmd.ExecuteString(Cmd.java:301)
at jake2.qcommon.exec.Cbuf.Execute(Cbuf.java:187)
at jake2.client.CL.SendCommand(CL.java:1405)
at jake2.client.CL.Frame(CL.java:1455)
at jake2.fullgame.Jake2.main(Jake2.java:126)

Looks like one of these functions (FS.SetGamedir or FS.ExecAutoexec) are messing with the cvarMap collection