File tree Expand file tree Collapse file tree 2 files changed +10
-3
lines changed
Expand file tree Collapse file tree 2 files changed +10
-3
lines changed Original file line number Diff line number Diff line change @@ -651,13 +651,21 @@ static CMD(ListMaps) {
651651//
652652
653653static CMD (Toggle ) {
654+ cvar_t * cvar ;
655+
654656 if (!param [0 ]) {
655657 I_Printf (" toggle <cvar>\n" );
656658 return ;
657659 }
658660
659- cvar_t * cvar = CON_CvarGet (param [0 ]);
660- cvar -> value = !cvar -> value ;
661+ cvar = CON_CvarGet (param [0 ]);
662+
663+ if (cvar == NULL ) {
664+ CON_Warnf ("\"%s\" doesn't exist\n" , param [0 ]);
665+ return ;
666+ }
667+
668+ M_SetCvar (cvar , (float )(!(int )cvar -> value )); /* StevenSYS: These casts look really stupid */
661669 return ;
662670}
663671
Original file line number Diff line number Diff line change @@ -115,7 +115,6 @@ static int registerSounds() {
115115 if (audio == NULL ) {
116116 failCount ++ ;
117117 } else {
118- I_Printf ("------%d\n" , sfxCount );
119118 sound .sounds [sfxCount ] = audio ;
120119 sfxLumpIndex [i ] = sfxCount ;
121120 successCount ++ ;
You can’t perform that action at this time.
0 commit comments