mirror of
https://github.com/MihailRis/voxelcore.git
synced 2026-10-09 04:51:49 +00:00
fix content stats
This commit is contained in:
parent
7132bb0758
commit
97eef3ef19
2 changed files with 24 additions and 15 deletions
|
|
@ -35,11 +35,13 @@ public:
|
|||
: allNames(allNames), type(type) {
|
||||
}
|
||||
|
||||
T& create(const std::string& id) {
|
||||
T& create(const std::string& id, bool* created = nullptr) {
|
||||
auto found = defs.find(id);
|
||||
if (found != defs.end()) {
|
||||
if (created) *created = false;
|
||||
return *found->second;
|
||||
}
|
||||
if (created) *created = true;
|
||||
checkIdentifier(id);
|
||||
allNames[id] = type;
|
||||
names.push_back(id);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue