Ticket #2807: replayWarnOnModMismatch_v2_2.diff
File replayWarnOnModMismatch_v2_2.diff, 2.6 KB (added by , 8 years ago) |
---|
-
binaries/data/mods/public/gui/credits/texts/programming.json
25 25 {"nick": "aBothe", "name": "Alexander Bothe"}, 26 26 {"nick": "alpha123", "name": "Peter P. Cannici"}, 27 27 {"nick": "andy5995", "name": "Andy Alt"}, 28 {"nick": "ArnH", "name": "Arno Hemelhof"}, 28 29 {"nick": "Aurium", "name": "Aurélio Heckert"}, 29 30 {"nick": "badmadblacksad", "name": "Martin F"}, 30 31 {"name": "Mikołaj \"Bajter\" Korcz"}, -
source/main.cpp
453 453 // run non-visual simulation replay if requested 454 454 if (isReplay) 455 455 { 456 if (!args.Has("mod")) 457 { 458 LOGERROR("At least one mod should be specified! Did you mean to add the argument '-mod=public'?"); 459 CXeromyces::Terminate(); 460 return; 461 } 456 462 Paths paths(args); 457 463 g_VFS = CreateVfs(20 * MiB); 458 464 g_VFS->Mount(L"cache/", paths.Cache(), VFS_MOUNT_ARCHIVABLE); -
source/ps/Replay.cpp
25 25 #include "lib/res/h_mgr.h" 26 26 #include "lib/tex/tex.h" 27 27 #include "ps/Game.h" 28 #include "ps/CLogger.h" 28 29 #include "ps/Loader.h" 29 30 #include "ps/Mod.h" 30 31 #include "ps/Profile.h" … … 168 169 JS::RootedValue attribs(cx); 169 170 ENSURE(g_Game->GetSimulation2()->GetScriptInterface().ParseJSON(line, &attribs)); 170 171 172 std::vector<CStr> replayModList; 173 g_Game->GetSimulation2()->GetScriptInterface().GetProperty(attribs, "mods", replayModList); 174 175 // Check for necessary mods which aren't loaded 176 for (const CStr& mod : replayModList) 177 if (mod != "user" && std::find(g_modsLoaded.begin(), g_modsLoaded.end(), mod) == g_modsLoaded.end()) 178 LOGWARNING("The mod '%s' is required by the replay file, but wasn't passed as an argument!", mod); 179 180 // Check for mods which are loaded, but weren't used when the replay was made 181 for (const CStr& mod : g_modsLoaded) 182 if (mod != "user" && std::find(replayModList.begin(), replayModList.end(), mod) == replayModList.end()) 183 LOGWARNING("The mod '%s' wasn't used when creating this replay file, but was passed as an argument!", mod); 184 171 185 g_Game->StartGame(&attribs, ""); 172 186 173 187 // TODO: Non progressive load can fail - need a decent way to handle this