mirror of
https://github.com/HarbourMasters/SpaghettiKart
synced 2026-08-31 10:01:02 -04:00
Fix NON_PORTABLE build. Ship::Context needs to be initialized first. (#618)
* Fix NON_PORTABLE build. Ship::Context needs to be initialized before resolving files. Move offending calls inside functions where they are used. Those will always be called after GameEngine() which runs Ship::Context::CreateUninitializedInstance() early. * Replace hardcoded string mk64.o2r and spaghetti.o2r with variables game_asset_file and engine_asset_file.
This commit is contained in:
@@ -19,8 +19,6 @@ void DetectOutdatedDependencies();
|
||||
void SortModsByDependencies();
|
||||
|
||||
std::vector<std::tuple<ModMetadata, std::shared_ptr<Ship::Archive>>> Mods = {};
|
||||
const std::string main_path = Ship::Context::GetPathRelativeToAppDirectory("mk64.o2r");
|
||||
const std::string assets_path = Ship::Context::LocateFileAcrossAppDirs("spaghetti.o2r");
|
||||
|
||||
void InitModsSystem() {
|
||||
CheckMK64O2RExists();
|
||||
@@ -65,6 +63,9 @@ void GenerateAssetsMods() {
|
||||
}
|
||||
|
||||
std::vector<std::string> ListMods() {
|
||||
const std::string main_path = Ship::Context::GetPathRelativeToAppDirectory(game_asset_file);
|
||||
const std::string assets_path = Ship::Context::LocateFileAcrossAppDirs(engine_asset_file);
|
||||
|
||||
std::vector<std::string> archiveFiles;
|
||||
if (std::filesystem::exists(main_path)) {
|
||||
archiveFiles.push_back(main_path);
|
||||
@@ -202,6 +203,8 @@ void AddCoreDependencies() {
|
||||
}
|
||||
|
||||
void CheckMK64O2RExists() {
|
||||
const std::string main_path = Ship::Context::GetPathRelativeToAppDirectory(game_asset_file);
|
||||
|
||||
if (!std::filesystem::exists(main_path)) {
|
||||
GenerateAssetsMods();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user