Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions tmxlite/src/Object.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -222,7 +222,7 @@ void Object::parseTemplate(const std::string& path, Map* map)
//load the template if not already loaded
if (templateObjects.count(path) == 0)
{
auto templatePath = map->getWorkingDirectory() + "/" + path;
auto templatePath = resolveFilePath(path, map->getWorkingDirectory());

pugi::xml_document doc;
if (!doc.load_file(templatePath.c_str()))
Expand All @@ -247,7 +247,8 @@ void Object::parseTemplate(const std::string& path, Map* map)
if (!tilesetName.empty() &&
templateTilesets.count(tilesetName) == 0)
{
templateTilesets.insert(std::make_pair(tilesetName, Tileset(map->getWorkingDirectory())));
//tileset source is relative to the template file, not the map
templateTilesets.insert(std::make_pair(tilesetName, Tileset(getFilePath(templatePath))));
templateTilesets.at(tilesetName).parse(tileset, map);
}
}
Expand Down
Loading