From cce13da17f4a902a19da808a6b3999607b9dd471 Mon Sep 17 00:00:00 2001 From: Alex Foster <123afoster@gmail.com> Date: Sat, 30 Sep 2023 23:59:53 +0900 Subject: [PATCH] string in loaddefaultparts --- src/engine/model/obj.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/engine/model/obj.cpp b/src/engine/model/obj.cpp index cb5b02d5d..20d82e846 100644 --- a/src/engine/model/obj.cpp +++ b/src/engine/model/obj.cpp @@ -288,12 +288,12 @@ void obj::objmeshgroup::flushmesh(const string meshname, bool obj::loaddefaultparts() { part &mdl = addpart(); - const char *pname = parentdir(name.c_str()); + std::string pname = parentdir(name.c_str()); DEF_FORMAT_STRING(name1, "media/model/%s/tris.obj", name.c_str()); mdl.meshes = sharemeshes(path(name1)); if(!mdl.meshes) { - DEF_FORMAT_STRING(name2, "media/model/%s/tris.obj", pname); // try obj in parent folder (vert sharing) + DEF_FORMAT_STRING(name2, "media/model/%s/tris.obj", pname.c_str()); // try obj in parent folder (vert sharing) mdl.meshes = sharemeshes(path(name2)); if(!mdl.meshes) { @@ -301,7 +301,7 @@ bool obj::loaddefaultparts() } } Texture *tex, *masks; - loadskin(name.c_str(), pname, tex, masks); + loadskin(name.c_str(), pname.c_str(), tex, masks); mdl.initskins(tex, masks); if(tex==notexture) {