MCPcopy Create free account
hub / github.com/GarageGames/Torque3D / setFieldValue

Method setFieldValue

Engine/source/console/simFieldDictionary.cpp:172–205  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

170
171
172void SimFieldDictionary::setFieldValue(StringTableEntry slotName, const char *value)
173{
174 U32 bucket = getHashValue(slotName);
175 Entry **walk = &mHashTable[bucket];
176 while(*walk && (*walk)->slotName != slotName)
177 walk = &((*walk)->next);
178
179 Entry *field = *walk;
180 if( !value || !*value )
181 {
182 if(field)
183 {
184 mVersion++;
185
186 if( field->value )
187 dFree(field->value);
188
189 *walk = field->next;
190 freeEntry(field);
191 }
192 }
193 else
194 {
195 if(field)
196 {
197 if( field->value )
198 dFree(field->value);
199
200 field->value = dStrdup(value);
201 }
202 else
203 addEntry( bucket, slotName, 0, dStrdup( value ) );
204 }
205}
206
207const char *SimFieldDictionary::getFieldValue(StringTableEntry slotName)
208{

Callers 15

guiEditor.ed.csFile · 0.45
shapeEditor.ed.csFile · 0.45
WeaponImageFunction · 0.45
guiEditor.ed.csFile · 0.45
shapeEditor.ed.csFile · 0.45

Calls 2

freeEntryFunction · 0.85
dFreeFunction · 0.50

Tested by

no test coverage detected