Skip to content

Variables registered with CV_RegisterVar no longer synchronizes properly over Netcode

If a Lua variable registers a console variable using CV_RegisterVar and passes the CV_NETVAR flag to it, changes to that variable won't synchronize properly with the clients.

To reproduce, put this script in a Lua file:

CV_RegisterVar({
	name = "test",
	defaultvalue = 5,
	flags = CV_NETVAR,
})

then start a dedicated server and join it. Change the variable on the dedicated server to, for example, 10, and you get this error on the client:

"10" is not a possible value for "allowmlook"

This breaking change is really serious, since it breaks a wide range of scripts that supports networking.