CVAR_Update: handle out of range
Posted: Wed Dec 21, 2011 10:27 am
I ran into a bug with my mod where the game crashes (back to the menu if running as qvm and a hard crash if running as dll). If it crashes back to the menu I get this error message: "CVAR_Update: handle out of range".
This happens only when the g_synchronousclients cvar is set to 1 and the mod starts an in-game cutscene.
In g_misc.c (line 63) you can see how cutscenes are implemented. It builds an info string and sets that as configstring. In cg_view.c there's the CG_CalcCutsceneViewValues function which reads the configstring and translates it back to a view position. It adjusts the cg.refdef values to move the player's view to the desired position.
Also, to make sure the client is in the same vis area as the camera should be (so the world is actually drawn), server-side the client's position is updated as well. This is done in g_main.c in the G_RunCutscene function (line 1400). It's called from G_RunFrame.
What's probably also of importance is that the player's pmove_type is set to PM_CUTSCENE, a new constant.
I guess this method does something that g_synchronousclients doesn't really like, but I'm not sure what exactly goes wrong (or what g_synchronousclients really does). I tried building ioQuake so I could take a closer look at what happens there, but when trying to build the ioq3.sln from the misc\msvc folder I get the error "cannot open input file 'SDLmain.lib'"
This happens only when the g_synchronousclients cvar is set to 1 and the mod starts an in-game cutscene.
In g_misc.c (line 63) you can see how cutscenes are implemented. It builds an info string and sets that as configstring. In cg_view.c there's the CG_CalcCutsceneViewValues function which reads the configstring and translates it back to a view position. It adjusts the cg.refdef values to move the player's view to the desired position.
Also, to make sure the client is in the same vis area as the camera should be (so the world is actually drawn), server-side the client's position is updated as well. This is done in g_main.c in the G_RunCutscene function (line 1400). It's called from G_RunFrame.
What's probably also of importance is that the player's pmove_type is set to PM_CUTSCENE, a new constant.
I guess this method does something that g_synchronousclients doesn't really like, but I'm not sure what exactly goes wrong (or what g_synchronousclients really does). I tried building ioQuake so I could take a closer look at what happens there, but when trying to build the ioq3.sln from the misc\msvc folder I get the error "cannot open input file 'SDLmain.lib'"