MCPcopy Create free account
hub / github.com/OpenTTD/OpenTTD / Clear

Method Clear

src/station_gui.cpp:1089–1095  ·  view source on GitHub ↗

* Delete all subentries, reset count and num_children and adapt parent's count. */

Source from the content-addressed store, hash-verified

1087 * Delete all subentries, reset count and num_children and adapt parent's count.
1088 */
1089void CargoDataEntry::Clear()
1090{
1091 if (this->children != nullptr) this->children->clear();
1092 if (this->parent != nullptr) this->parent->count -= this->count;
1093 this->count = 0;
1094 this->num_children = 0;
1095}
1096
1097/**
1098 * Remove a subentry from this one and delete it.

Callers 2

~CargoDataEntryMethod · 0.95
RecalcDestinationsMethod · 0.45

Calls 1

clearMethod · 0.45

Tested by

no test coverage detected