void ReloadToTexturedModel(string model, string texture)
{
string locid = "";
ref loc;
for(int i = 0; i < nLocationsNum; i++)
{
loc = &Locations[i];
if(!CheckAttribute(loc, "filespath.models")) continue;
if(texture == "")
{
LogIt("Searching for location with default folder");
if(CheckAttribute(loc, "filespath.textures")) continue;
if(loc.filespath.models == "locations\" + model)
{
locid = loc.id;
break;
}
}
else
{
LogIt("Searching for location with folder " + texture);
if(!CheckAttribute(loc, "filespath.textures")) continue;
if(loc.filespath.models == "locations\" + model && loc.filespath.textures == "locations\" + texture)
{
locid = loc.id;
break;
}
}
}
if(texture == "") texture = "DEFAULT";
if(locid != "") DoQuestReloadToLocation(locid, "reload", loc.reload.l1.name, "");
else LogIt("No location with model folder = " + model + " and texture folder = " + texture);
}