1
0
mirror of https://github.com/luanti-org/luanti.git synced 2026-01-01 10:45:32 +01:00

Client: Fix crash in 'plantlike' nodes with no textures (#16792)

This commit is contained in:
SmallJoker
2025-12-31 15:19:23 +01:00
committed by GitHub
parent ed62451ad3
commit 7a73d37aee

View File

@@ -130,9 +130,7 @@ static video::ITexture *extractTexture(const TileDef &def, const TileLayer &laye
assert(ret->getType() == video::ETT_2D); assert(ret->getType() == video::ETT_2D);
return ret; return ret;
} }
if (!def.name.empty()) return tsrc->getTextureForMesh(def.name.empty() ? "no_texture.png" : def.name);
return tsrc->getTextureForMesh(def.name);
return nullptr;
} }
void getAdHocNodeShader(video::SMaterial &mat, IShaderSource *shdsrc, void getAdHocNodeShader(video::SMaterial &mat, IShaderSource *shdsrc,
@@ -711,6 +709,7 @@ void createItemMesh(Client *client, const ItemDefinition &def,
break; break;
} }
} }
FATAL_ERROR_IF(!mesh, ("mesh creation failed for " + def.name).c_str());
for (u32 i = 0; i < mesh->getMeshBufferCount(); ++i) { for (u32 i = 0; i < mesh->getMeshBufferCount(); ++i) {
scene::IMeshBuffer *buf = mesh->getMeshBuffer(i); scene::IMeshBuffer *buf = mesh->getMeshBuffer(i);