MCPcopy Create free account
hub / github.com/JACoders/OpenJK / Cvar_Unset

Function Cvar_Unset

code/qcommon/cvar.cpp:1099–1132  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1097*/
1098
1099cvar_t *Cvar_Unset(cvar_t *cv)
1100{
1101 cvar_t *next = cv->next;
1102
1103 // note what types of cvars have been modified (userinfo, archive, serverinfo, systeminfo)
1104 cvar_modifiedFlags |= cv->flags;
1105
1106 if(cv->name)
1107 Cvar_FreeString(cv->name);
1108 if(cv->string)
1109 Cvar_FreeString(cv->string);
1110 if(cv->latchedString)
1111 Cvar_FreeString(cv->latchedString);
1112 if(cv->resetString)
1113 Cvar_FreeString(cv->resetString);
1114
1115 if(cv->prev)
1116 cv->prev->next = cv->next;
1117 else
1118 cvar_vars = cv->next;
1119 if(cv->next)
1120 cv->next->prev = cv->prev;
1121
1122 if(cv->hashPrev)
1123 cv->hashPrev->hashNext = cv->hashNext;
1124 else
1125 hashTable[cv->hashIndex] = cv->hashNext;
1126 if(cv->hashNext)
1127 cv->hashNext->hashPrev = cv->hashPrev;
1128
1129 memset(cv, 0, sizeof(*cv));
1130
1131 return next;
1132}
1133
1134/*
1135============

Callers 3

Cvar_Unset_fFunction · 0.70
Cvar_UnsetUserCreated_fFunction · 0.70
Cvar_RestartFunction · 0.70

Calls 1

Cvar_FreeStringFunction · 0.70

Tested by

no test coverage detected