@@ -160,10 +160,25 @@ not have future snapshot_t executed before it is executed
160
160
void SV_AddServerCommand ( client_t * client , const char * cmd ) {
161
161
int index , i ;
162
162
163
- // this is very ugly but it's also a waste to for instance send multiple config string updates
164
- // for the same config string index in one snapshot
165
- if ( !strncmp (cmd , "cs " , 3 ) && SV_ReplacePendingServerCommands (client , cmd ) ) {
166
- return ;
163
+ if ( com_protocol -> integer >= PROTOCOL_MOHTA_MIN ) {
164
+ // Added in 2.0
165
+ // Requires spearhead clients.
166
+ // Unfortunately in MOHAA 1.11, replacing cs can cause clients to crash
167
+ // when an existing model is moved into a lower configstring.
168
+ // For example:
169
+ // cs 138 models/weapons/mp40.tik
170
+ // cs 117 models/weapons/m1_garand.tik
171
+ // 1) models/weapons/mp40.tik is already referenced by cs 117, it will cause the model handle to be referenced twice.
172
+ // 2) when the client executes "cs 117", it will free up the mp40.tik model, leaving a dangling handle for cs 138.
173
+
174
+ // FIXME: To make it work on MOHAA clients, reorder configstrings that are sent to clients.
175
+ // For example, always put "cs 117" before "cs 138".
176
+
177
+ // this is very ugly but it's also a waste to for instance send multiple config string updates
178
+ // for the same config string index in one snapshot
179
+ if ( !strncmp ( cmd , "cs " , 3 ) && SV_ReplacePendingServerCommands ( client , cmd ) ) {
180
+ return ;
181
+ }
167
182
}
168
183
169
184
// do not send commands until the gamestate has been sent
0 commit comments