You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The dummy is considered connected by the engine client (`IClient::DummyConnected` function returns `true`) after receiving `NETMSG_CON_READY`, which also causes `cl_dummy` to be set to `1`. However, the game client does not have the dummy's client ID until a snapshot is received, which means `m_aLocalIds[1]` (i.e. `m_aLocalIds[g_Config.m_ClDummy]`) is still set to `-1` (or an old value from when the dummy was last connected on the server) for a moment when connecting the dummy.
This was noticeable by connecting the dummy and quickly opening the emoticon HUD, which would briefly render invalid skins for the eye emote preview based on out-of-bounds `CTeeRenderInfo`.
In the other cases, the use of invalid local IDs could be confirmed by adding assertions. For example the hammer direction with `cl_dummy_hammer 1` was using out-of-bounds position data when connecting the dummy and immediately switching back to the main player.
This is fixed by adding checks for all uses of the local IDs, same as for the `m_Snap.m_LocalClientId` variable.
The local ID of the dummy, i.e. `m_aLocalIds[1]`, is now also reset when the dummy is disconnected. Previously, the value was only considered valid when also calling the `DummyConnected` function, which, however, was not enough due to the `m_aLocalIds[1]` value not being updated at the same time as the `DummyConnected` function. By resetting `m_aLocalIds[1]` to `-1` when the dummy is disconnected, the additional calls to the `DummyConnected` function are unnecessary.
0 commit comments