diff --git a/.github/workflows/coop.yaml b/.github/workflows/coop.yaml new file mode 100644 index 000000000..0d287f57c --- /dev/null +++ b/.github/workflows/coop.yaml @@ -0,0 +1,24 @@ +name: Build coop + +on: + push: + branches: + - dev + pull_request: + branches: + - "**" + +jobs: + build: + runs-on: ubuntu-latest + steps: + - name: Checkout repository + uses: actions/checkout@v4 + + - name: Install dependencies + run: | + sudo apt update + sudo apt install -y build-essential git python3 libglew-dev libsdl2-dev libz-dev libcurl4-openssl-dev + + - name: Build the game + run: make -j$(nproc) diff --git a/src/pc/rom_checker.cpp b/src/pc/rom_checker.cpp index f0f7ee68b..2024dd0de 100644 --- a/src/pc/rom_checker.cpp +++ b/src/pc/rom_checker.cpp @@ -57,7 +57,6 @@ static bool is_rom_valid(const std::string romPath) { ss << std::hex << std::setw(2) << std::setfill('0') << static_cast(dataHash[i]); } - bool foundHash = false; for (VanillaMD5 *md5 = sVanillaMD5; md5->localizationName != NULL; md5++) { if (md5->md5 == ss.str()) { std::string destPath = fs_get_write_path("") + std::string("baserom.") + md5->localizationName + ".z64"; @@ -72,12 +71,11 @@ static bool is_rom_valid(const std::string romPath) { snprintf(gRomFilename, SYS_MAX_PATH, "%s", destPath.c_str()); // Load the copied rom gRomIsValid = true; - foundHash = true; - break; + return true; } } - return foundHash; + return false; } inline static bool scan_path_for_rom(const char *dir) { @@ -104,11 +102,9 @@ bool main_rom_handler(void) { #ifdef LOADING_SCREEN_SUPPORTED void rom_on_drop_file(const char *path) { static bool hasDroppedInvalidFile = false; - if (strlen(path) > 0) { - if (!is_rom_valid(path) && !hasDroppedInvalidFile) { - hasDroppedInvalidFile = true; - strcat(gCurrLoadingSegment.str, "\n\\#ffc000\\The file you last dropped was not a valid, vanilla SM64 rom."); - } + if (strlen(path) > 0 && !is_rom_valid(path) && !hasDroppedInvalidFile) { + hasDroppedInvalidFile = true; + strcat(gCurrLoadingSegment.str, "\n\\#ffc000\\The file you last dropped was not a valid, vanilla SM64 rom."); } } #endif