Fix "does not exist" showing up when loading stamps by id or filepath in console

SetLastError will always cause the error to show up in the console. Use tempfile->GetError() instead, which will return the same error message anyway unless the stamp doesn't exist.
This commit is contained in:
jacob1 2023-12-30 20:34:22 -05:00
parent 2619050824
commit cdc3eb8663
No known key found for this signature in database
GPG Key ID: 4E58A32D510E1995
2 changed files with 1 additions and 2 deletions

View File

@ -445,7 +445,6 @@ std::unique_ptr<SaveFile> Client::LoadSaveFile(ByteString filename)
{
file->SetLoadingError(err.FromUtf8());
}
commandInterface->SetLastError(err.FromUtf8());
}
return file;
}

View File

@ -2232,7 +2232,7 @@ int LuaScriptInterface::simulation_loadStamp(lua_State * l)
{
pushed = 2;
lua_pushnil(l);
tpt_lua_pushString(l, luacon_ci->GetLastError());
tpt_lua_pushString(l, tempfile ? tempfile->GetError() : "does not exist");
}
return pushed;
}