Skip to content

Commit

Permalink
string in loaddefaultparts
Browse files Browse the repository at this point in the history
  • Loading branch information
no-lex committed Sep 30, 2023
1 parent ada15e3 commit cce13da
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/engine/model/obj.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -288,20 +288,20 @@ 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)
{
return false;
}
}
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)
{
Expand Down

0 comments on commit cce13da

Please sign in to comment.