MCPcopy Create free account
hub / github.com/WolfireGames/overgrowth / ClearDescID

Function ClearDescID

Source/Game/EntityDescription.cpp:1323–1334  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1321}
1322
1323void ClearDescID(EntityDescription* desc) {
1324 EntityDescriptionField* edf = desc->GetEditableField(EDF_ID);
1325 if (edf) {
1326 edf->data.clear();
1327 int null_id = -1;
1328 memwrite(&null_id, sizeof(int), 1, edf->data);
1329 }
1330 EntityDescriptionList& children = desc->children;
1331 for (auto& it : children) {
1332 ClearDescID(&it);
1333 }
1334}
1335
1336void EntityDescriptionField::ReadInt(int* id) const {
1337 memread(id, sizeof(int), 1, data);

Callers 1

DuplicateObjectMethod · 0.85

Calls 3

memwriteFunction · 0.85
GetEditableFieldMethod · 0.80
clearMethod · 0.45

Tested by

no test coverage detected