============ idInternalCVar::Set ============ */
| 307 | ============ |
| 308 | */ |
| 309 | void idInternalCVar::Set( const char *newValue, bool force, bool fromServer ) { |
| 310 | if ( session && session->IsMultiplayer() && !fromServer ) { |
| 311 | #ifndef ID_TYPEINFO |
| 312 | if ( ( flags & CVAR_NETWORKSYNC ) && idAsyncNetwork::client.IsActive() ) { |
| 313 | common->Printf( "%s is a synced over the network and cannot be changed on a multiplayer client.\n", nameString.c_str() ); |
| 314 | #if ID_ALLOW_CHEATS |
| 315 | common->Printf( "ID_ALLOW_CHEATS override!\n" ); |
| 316 | #else |
| 317 | return; |
| 318 | #endif |
| 319 | } |
| 320 | #endif |
| 321 | if ( ( flags & CVAR_CHEAT ) && !cvarSystem->GetCVarBool( "net_allowCheats" ) ) { |
| 322 | common->Printf( "%s cannot be changed in multiplayer.\n", nameString.c_str() ); |
| 323 | #if ID_ALLOW_CHEATS |
| 324 | common->Printf( "ID_ALLOW_CHEATS override!\n" ); |
| 325 | #else |
| 326 | return; |
| 327 | #endif |
| 328 | } |
| 329 | } |
| 330 | |
| 331 | if ( !newValue ) { |
| 332 | newValue = resetString.c_str(); |
| 333 | } |
| 334 | |
| 335 | if ( !force ) { |
| 336 | if ( flags & CVAR_ROM ) { |
| 337 | common->Printf( "%s is read only.\n", nameString.c_str() ); |
| 338 | return; |
| 339 | } |
| 340 | |
| 341 | if ( flags & CVAR_INIT ) { |
| 342 | common->Printf( "%s is write protected.\n", nameString.c_str() ); |
| 343 | return; |
| 344 | } |
| 345 | } |
| 346 | |
| 347 | if ( valueString.Icmp( newValue ) == 0 ) { |
| 348 | return; |
| 349 | } |
| 350 | |
| 351 | valueString = newValue; |
| 352 | value = valueString.c_str(); |
| 353 | UpdateValue(); |
| 354 | |
| 355 | SetModified(); |
| 356 | cvarSystem->SetModifiedFlags( flags ); |
| 357 | } |
| 358 | |
| 359 | /* |
| 360 | ============ |
no test coverage detected