mirror of
https://github.com/MihailRis/voxelcore.git
synced 2026-10-10 13:31:49 +00:00
content-loader icon-type reset fix
This commit is contained in:
parent
36a5da5bc1
commit
2aaa37bb7d
1 changed files with 2 additions and 2 deletions
|
|
@ -221,7 +221,7 @@ void ContentLoader::loadCustomBlockModel(Block* def, dynamic::Map* primitives) {
|
||||||
|
|
||||||
void ContentLoader::loadItem(ItemDef* def, std::string name, fs::path file) {
|
void ContentLoader::loadItem(ItemDef* def, std::string name, fs::path file) {
|
||||||
auto root = files::read_json(file);
|
auto root = files::read_json(file);
|
||||||
std::string iconTypeStr = "none";
|
std::string iconTypeStr = "";
|
||||||
root->str("icon-type", iconTypeStr);
|
root->str("icon-type", iconTypeStr);
|
||||||
if (iconTypeStr == "none") {
|
if (iconTypeStr == "none") {
|
||||||
def->iconType = item_icon_type::none;
|
def->iconType = item_icon_type::none;
|
||||||
|
|
@ -229,7 +229,7 @@ void ContentLoader::loadItem(ItemDef* def, std::string name, fs::path file) {
|
||||||
def->iconType = item_icon_type::block;
|
def->iconType = item_icon_type::block;
|
||||||
} else if (iconTypeStr == "sprite") {
|
} else if (iconTypeStr == "sprite") {
|
||||||
def->iconType = item_icon_type::sprite;
|
def->iconType = item_icon_type::sprite;
|
||||||
} else {
|
} else if (iconTypeStr.length()){
|
||||||
std::cerr << "unknown icon type" << iconTypeStr << std::endl;
|
std::cerr << "unknown icon type" << iconTypeStr << std::endl;
|
||||||
}
|
}
|
||||||
root->str("icon", def->icon);
|
root->str("icon", def->icon);
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue