SpiritQuaddicted / reQuiem

reQuiem is a custom OpenGL Quake engine for Windows and Linux. It's designed for maximum compatibility with all things Quake - past, present and future. It's fast, reliable, and easy to configure. In short: it fixes what was broken, improves what needed improving, and leaves the rest alone. It was developed by jdhack.
GNU General Public License v2.0
17 stars 2 forks source link

don't generate bad svc_spawnstatic commands at changelevel #40

Closed neogeographica closed 10 years ago

neogeographica commented 10 years ago

Resolves issue #16.

PF_makestatic has some additional code for supporting the "create" command. However, this can incorrectly run during a changelevel (because the client spawned flag is true), pushing extraneous svc_spawnstatic commands to the client.

The client will parse the commands incorrectly because it hasn't yet received the svc_serverinfo command that sets the protocol version. This results in some "command parsing roulette" which may or may not cause the level load to fail.

Adding this check of sv.state ensures that the extra code will not be run during changelevel. I left the other checks in place just to be safe... the create command is a test/debug command in any case so a few extra checks are not a performance concern.

If we were to be the most precise & complete about the bit of functionality in this function, we should probably send the svc_spawnstatic message to all clients. Leave it up to Host_Create_f to decide if the "create" command should be limited to the single-local-client case or not. But, let's do minimal changes for now and just fix the bug.

The test cases of the zendar and masque map changes work now. The create command still works too.