Skip to content

Commit

Permalink
fix: Fixed an oopsie copy/paste bug causing crash
Browse files Browse the repository at this point in the history
  • Loading branch information
wired420 committed Dec 5, 2023
1 parent 18d1937 commit 24e8d19
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 12 deletions.
16 changes: 8 additions & 8 deletions MQ2MeshManager.cpp
Expand Up @@ -102,7 +102,7 @@ static std::chrono::steady_clock::time_point HashThreadTimer = std::chrono::stea
unsigned short DownloadThreadCount = 0;
unsigned short HashThreadCount = 0;
std::string fCurrentDL = "none", fLastDL = "none", fPathDL = "none", LastMsg = "none";
unsigned short fProgressDL = 0;
double fProgressDL = 0;
bool fDownloading = false;
std::list<DownloadListStorage> DownloadList;
std::list<HashListStorage> HashpipeList;
Expand All @@ -116,8 +116,8 @@ bool ThreadSafe = true;
int ThreadLockSeconds = 20;
bool AutoDownloadMissing = false, AutoCheckForUpdates = false;
bool _init = false;
const int MaxZone = 553;
static const char* Zones[553] = { "aalishai", "abysmal", "acrylia", "airplane", "akanon", "akheva", "akhevatwo", "alkabormare", "anguish", "ankexfen", "arcstone", "arelis", "arena", "argath", "arginhiz", "arthicrex", "arxmentis", "ashengate", "atiiki", "barindu", "barren", "basilica", "bazaar", "beastdomain", "befallen", "beholder", "bertoxtemple", "bixiewarfront", "blackburrow", "blacksail", "bloodfalls", "bloodfields", "bloodmoon", "bothunder", "breedinggrounds", "brellsarena", "brellsrest", "brellstemple", "broodlands", "brotherisland", "buriedsea", "burningwood", "butcher", "cabeast", "cabwest", "cauldron", "causeway", "cazicthule", "chamberoftears", "chambersa", "chambersb", "chambersc", "chambersd", "chamberse", "chambersf", "chapterhouse", "charasis", "charasisb", "charasistwo", "chardok", "chardokb", "chardoktwo", "chelsithreborn", "citymist", "cityofbronze", "cobaltscar", "cobaltscartwo", "codecay", "codecayb", "commonlands", "convorteum", "coolingchamber", "corathus", "corathusa", "corathusb", "cosul", "crescent", "crushbone", "cryptofshade", "crystal", "crystallos", "crystalshard", "crystaltwoa", "crystaltwob", "dalnir", "darklightcaverns", "dawnshroud", "deadbone", "deadhills", "deepshade", "degmar", "delvea", "delveb", "devastation", "devastationa", "direwind", "discord", "discordtower", "drachnidhive", "drachnidhivea", "drachnidhiveb", "drachnidhivec", "dragoncrypt", "dragonscale", "dragonscalea", "dragonscaleb", "dranik", "dranikcatacombsa", "dranikcatacombsb", "dranikcatacombsc", "dranikhollowsa", "dranikhollowsb", "dranikhollowsc", "draniksewersa", "draniksewersb", "draniksewersc", "draniksscar", "dreadlands", "dreadspire", "dredge", "droga", "drogab", "dulak", "eastkarana", "eastkorlach", "eastkorlacha", "eastsepulcher", "eastwastes", "eastwastesshard", "eastwastestwo", "echo", "elddar", "elddara", "emeraldjungle", "empyr", "endlesscaverns", "erudnext", "erudnint", "erudsxing", "esianti", "ethernere", "everfrost", "eviltree", "exalted", "exaltedb", "fallen", "fearplane", "feerrott", "feerrott2", "felwithea", "felwitheb", "ferubi", "fhalls", "fieldofbone", "firefallpass", "firiona", "foundation", "freeportacademy", "freeportarena", "freeportcityhall", "freeporteast", "freeporthall", "freeportmilitia", "freeportsewers", "freeporttheater", "freeportwest", "freporte", "freportn", "freportw", "frontiermtns", "frontiermtnsb", "frostcrypt", "frozenshadow", "frozenshadowtwo", "fungalforest", "fungusgrove", "gfaydark", "gnomemtn", "gorowyn", "greatdivide", "greatdividetwo", "grelleth", "griegsend", "grimling", "grobb", "growthplane", "guardian", "guildhall", "guildhall3", "guildhalllrg", "guildhallsml", "guildlobby", "guka", "gukb", "gukbottom", "gukc", "gukd", "guke", "gukf", "gukg", "gukh", "guktop", "gunthak", "gyrospireb", "gyrospirez", "halas", "harbingers", "hateplane", "hateplaneb", "hatesfury", "heartoffear", "heartoffearb", "heartoffearc", "herosforge", "highkeep", "highpasshold", "hillsofshade", "hohonora", "hohonorb", "hole", "hollowshade", "hollowshadetwo", "housegarden", "iceclad", "icefall", "ikkinz", "illsalin", "illsalina", "illsalinb", "illsalinc", "inktuta", "innothuleb", "jaggedpine", "jardelshook", "kael", "kaelshard", "kaeltwo", "kaesora", "kaladima", "kaladimb", "karnor", "katta", "kattacastrum", "kattacastrumb", "kedge", "kithicor", "kodtaz", "korascian", "korshaext", "korshaint", "kurn", "lakeofillomen", "lakerathe", "laurioninn", "lavastorm", "lceanium", "letalis", "lfaydark", "lichencreep", "lopingplains", "maiden", "", "maidensgrave", "maidentwo", "mansion", "mearatas", "mechanotus", "mesa", "mira", "miragulmare", "mirb", "mirc", "mird", "mire", "mirf", "mirg", "mirh", "miri", "mirj", "mischiefplane", "mistmoore", "mistythicket", "mmca", "mmcb", "mmcc", "mmcd", "mmce", "mmcf", "mmcg", "mmch", "mmci", "mmcj", "monkeyrock", "moors", "moorsofnokk", "morellcastle", "mseru", "nadox", "najena", "natimbi", "necropolis", "necropolistwo", "nedaria", "neighborhood", "nektulos", "nektulosa", "neriaka", "neriakb", "neriakc", "neriakd", "netherbian", "nexus", "nightmareb", "northkarana", "northro", "nro", "nurga", "oceangreenhills", "oceangreenvillage", "oceanoftears", "oggok", "oldblackburrow", "oldbloodfield", "oldcommons", "olddranik", "oldfieldofbone", "oldfieldofboneb", "oldkaesoraa", "oldkaesorab", "oldkithicor", "oldkurn", "overthere", "overtheretwo", "paineel", "pallomen", "paludal", "paludaltwo", "paw", "pellucid", "permafrost", "phinteriortree", "phylactery", "pillarsalra", "plhdkeinteriors1a1", "plhdkeinteriors1a2", "plhdkeinteriors1a3", "plhdkeinteriors3a1", "plhdkeinteriors3a2", "plhdkeinteriors3a3", "plhogrinteriors1a1", "plhogrinteriors1a2", "plhogrinteriors3a1", "plhogrinteriors3a2", "plhogrinteriors3b1", "plhogrinteriors3b2", "poair", "podisease", "poeartha", "poearthb", "pofire", "pohealth", "poinnovation", "pojustice", "poknowledge", "ponightmare", "poshadow", "postorms", "potactics", "potimea", "potimeb", "potorment", "potranquility", "povalor", "powar", "powater", "precipiceofwar", "provinggrounds", "qcat", "qey2hh1", "qeynos", "qeynos2", "qeytoqrg", "qinimi", "qrg", "qvic", "rage", "ragea", "rathechamber", "rathemtn", "redfeather", "relic", "resplendent", "riftseekers", "rivervale", "riwwi", "roost", "rubak", "ruja", "rujb", "rujc", "rujd", "ruje", "rujf", "rujg", "rujh", "ruji", "rujj", "runnyeye", "sarithcity", "scarlet", "scorchedwoods", "sebilis", "sepulcher", "shadeweaver", "shadeweavertwo", "shadowedmount", "shadowhaven", "shadowhaventwo", "shadowrest", "shadowspine", "shadowvalley", "shardslanding", "sharvahl", "sharvahltwo", "shiningcity", "shipmvm", "shipmvp", "shipmvu", "shippvu", "shipuvu", "shipworkshop", "silyssar", "sirens", "skyfire", "skyfiretwo", "skylance", "skyshrine", "skyshrinetwo", "sleeper", "sleepertwo", "sncrematory", "snlair", "snplant", "snpool", "soldunga", "soldungb", "soldungc", "solrotower", "soltemple", "solteris", "somnium", "southkarana", "southro", "sseru", "ssratemple", "steamfactory", "steamfontmts", "steppes", "stillmoona", "stillmoonb", "stonebrunt", "stonehive", "stonesnake", "stratos", "suncrest", "sunderock", "swampofnohope", "tacvi", "taka", "takb", "takc", "takd", "take", "takf", "takg", "takh", "taki", "takishruins", "takishruinsa", "takj", "tempesttemple", "templeveeshan", "templeveeshantwo", "tenebrous", "thalassius", "theater", "theatera", "thedeep", "thegrey", "thenest", "thevoida", "thevoidb", "thevoidc", "thevoidd", "thevoide", "thevoidf", "thevoidg", "thevoidh", "thuledream", "thulehouse1", "thulehouse2", "thulelibrary", "thuliasaur", "thundercrest", "thurgadina", "thurgadinb", "timorous", "timorousfalls", "tipt", "torgiran", "toskirakk", "towerofrot", "toxxulia", "trakanon", "trialsofsmoke", "tutoriala", "tutorialb", "twilight", "txevu", "umbral", "umbraltwo", "underquarry", "unkemptwoods", "unrest", "uqua", "valdeholm", "veeshan", "veeshantwo", "veksar", "velketor", "velketortwo", "vergalid", "vexthal", "vexthaltwo", "vxed", "wakening", "wallofslaughter", "warrens", "warslikswood", "weddingchapel", "weddingchapeldark", "well", "westkorlach", "westkorlacha", "westkorlachb", "westkorlachc", "westsepulcher", "westwastes", "westwastestwo", "windsong", "xorbb", "yxtta", "zhisza" };
const int MaxZone = 552;
static const char* Zones[552] = { "aalishai", "abysmal", "acrylia", "airplane", "akanon", "akheva", "akhevatwo", "alkabormare", "anguish", "ankexfen", "arcstone", "arelis", "arena", "argath", "arginhiz", "arthicrex", "arxmentis", "ashengate", "atiiki", "barindu", "barren", "basilica", "bazaar", "beastdomain", "befallen", "beholder", "bertoxtemple", "bixiewarfront", "blackburrow", "blacksail", "bloodfalls", "bloodfields", "bloodmoon", "bothunder", "breedinggrounds", "brellsarena", "brellsrest", "brellstemple", "broodlands", "brotherisland", "buriedsea", "burningwood", "butcher", "cabeast", "cabwest", "cauldron", "causeway", "cazicthule", "chamberoftears", "chambersa", "chambersb", "chambersc", "chambersd", "chamberse", "chambersf", "chapterhouse", "charasis", "charasisb", "charasistwo", "chardok", "chardokb", "chardoktwo", "chelsithreborn", "citymist", "cityofbronze", "cobaltscar", "cobaltscartwo", "codecay", "codecayb", "commonlands", "convorteum", "coolingchamber", "corathus", "corathusa", "corathusb", "cosul", "crescent", "crushbone", "cryptofshade", "crystal", "crystallos", "crystalshard", "crystaltwoa", "crystaltwob", "dalnir", "darklightcaverns", "dawnshroud", "deadbone", "deadhills", "deepshade", "degmar", "delvea", "delveb", "devastation", "devastationa", "direwind", "discord", "discordtower", "drachnidhive", "drachnidhivea", "drachnidhiveb", "drachnidhivec", "dragoncrypt", "dragonscale", "dragonscalea", "dragonscaleb", "dranik", "dranikcatacombsa", "dranikcatacombsb", "dranikcatacombsc", "dranikhollowsa", "dranikhollowsb", "dranikhollowsc", "draniksewersa", "draniksewersb", "draniksewersc", "draniksscar", "dreadlands", "dreadspire", "dredge", "droga", "drogab", "dulak", "eastkarana", "eastkorlach", "eastkorlacha", "eastsepulcher", "eastwastes", "eastwastesshard", "eastwastestwo", "echo", "elddar", "elddara", "emeraldjungle", "empyr", "endlesscaverns", "erudnext", "erudnint", "erudsxing", "esianti", "ethernere", "everfrost", "eviltree", "exalted", "exaltedb", "fallen", "fearplane", "feerrott", "feerrott2", "felwithea", "felwitheb", "ferubi", "fhalls", "fieldofbone", "firefallpass", "firiona", "foundation", "freeportacademy", "freeportarena", "freeportcityhall", "freeporteast", "freeporthall", "freeportmilitia", "freeportsewers", "freeporttheater", "freeportwest", "freporte", "freportn", "freportw", "frontiermtns", "frontiermtnsb", "frostcrypt", "frozenshadow", "frozenshadowtwo", "fungalforest", "fungusgrove", "gfaydark", "gnomemtn", "gorowyn", "greatdivide", "greatdividetwo", "grelleth", "griegsend", "grimling", "grobb", "growthplane", "guardian", "guildhall", "guildhall3", "guildhalllrg", "guildhallsml", "guildlobby", "guka", "gukb", "gukbottom", "gukc", "gukd", "guke", "gukf", "gukg", "gukh", "guktop", "gunthak", "gyrospireb", "gyrospirez", "halas", "harbingers", "hateplane", "hateplaneb", "hatesfury", "heartoffear", "heartoffearb", "heartoffearc", "herosforge", "highkeep", "highpasshold", "hillsofshade", "hohonora", "hohonorb", "hole", "hollowshade", "hollowshadetwo", "housegarden", "iceclad", "icefall", "ikkinz", "illsalin", "illsalina", "illsalinb", "illsalinc", "inktuta", "innothuleb", "jaggedpine", "jardelshook", "kael", "kaelshard", "kaeltwo", "kaesora", "kaladima", "kaladimb", "karnor", "katta", "kattacastrum", "kattacastrumb", "kedge", "kithicor", "kodtaz", "korascian", "korshaext", "korshaint", "kurn", "lakeofillomen", "lakerathe", "laurioninn", "lavastorm", "lceanium", "letalis", "lfaydark", "lichencreep", "lopingplains", "maiden", "maidensgrave", "maidentwo", "mansion", "mearatas", "mechanotus", "mesa", "mira", "miragulmare", "mirb", "mirc", "mird", "mire", "mirf", "mirg", "mirh", "miri", "mirj", "mischiefplane", "mistmoore", "mistythicket", "mmca", "mmcb", "mmcc", "mmcd", "mmce", "mmcf", "mmcg", "mmch", "mmci", "mmcj", "monkeyrock", "moors", "moorsofnokk", "morellcastle", "mseru", "nadox", "najena", "natimbi", "necropolis", "necropolistwo", "nedaria", "neighborhood", "nektulos", "nektulosa", "neriaka", "neriakb", "neriakc", "neriakd", "netherbian", "nexus", "nightmareb", "northkarana", "northro", "nro", "nurga", "oceangreenhills", "oceangreenvillage", "oceanoftears", "oggok", "oldblackburrow", "oldbloodfield", "oldcommons", "olddranik", "oldfieldofbone", "oldfieldofboneb", "oldkaesoraa", "oldkaesorab", "oldkithicor", "oldkurn", "overthere", "overtheretwo", "paineel", "pallomen", "paludal", "paludaltwo", "paw", "pellucid", "permafrost", "phinteriortree", "phylactery", "pillarsalra", "plhdkeinteriors1a1", "plhdkeinteriors1a2", "plhdkeinteriors1a3", "plhdkeinteriors3a1", "plhdkeinteriors3a2", "plhdkeinteriors3a3", "plhogrinteriors1a1", "plhogrinteriors1a2", "plhogrinteriors3a1", "plhogrinteriors3a2", "plhogrinteriors3b1", "plhogrinteriors3b2", "poair", "podisease", "poeartha", "poearthb", "pofire", "pohealth", "poinnovation", "pojustice", "poknowledge", "ponightmare", "poshadow", "postorms", "potactics", "potimea", "potimeb", "potorment", "potranquility", "povalor", "powar", "powater", "precipiceofwar", "provinggrounds", "qcat", "qey2hh1", "qeynos", "qeynos2", "qeytoqrg", "qinimi", "qrg", "qvic", "rage", "ragea", "rathechamber", "rathemtn", "redfeather", "relic", "resplendent", "riftseekers", "rivervale", "riwwi", "roost", "rubak", "ruja", "rujb", "rujc", "rujd", "ruje", "rujf", "rujg", "rujh", "ruji", "rujj", "runnyeye", "sarithcity", "scarlet", "scorchedwoods", "sebilis", "sepulcher", "shadeweaver", "shadeweavertwo", "shadowedmount", "shadowhaven", "shadowhaventwo", "shadowrest", "shadowspine", "shadowvalley", "shardslanding", "sharvahl", "sharvahltwo", "shiningcity", "shipmvm", "shipmvp", "shipmvu", "shippvu", "shipuvu", "shipworkshop", "silyssar", "sirens", "skyfire", "skyfiretwo", "skylance", "skyshrine", "skyshrinetwo", "sleeper", "sleepertwo", "sncrematory", "snlair", "snplant", "snpool", "soldunga", "soldungb", "soldungc", "solrotower", "soltemple", "solteris", "somnium", "southkarana", "southro", "sseru", "ssratemple", "steamfactory", "steamfontmts", "steppes", "stillmoona", "stillmoonb", "stonebrunt", "stonehive", "stonesnake", "stratos", "suncrest", "sunderock", "swampofnohope", "tacvi", "taka", "takb", "takc", "takd", "take", "takf", "takg", "takh", "taki", "takishruins", "takishruinsa", "takj", "tempesttemple", "templeveeshan", "templeveeshantwo", "tenebrous", "thalassius", "theater", "theatera", "thedeep", "thegrey", "thenest", "thevoida", "thevoidb", "thevoidc", "thevoidd", "thevoide", "thevoidf", "thevoidg", "thevoidh", "thuledream", "thulehouse1", "thulehouse2", "thulelibrary", "thuliasaur", "thundercrest", "thurgadina", "thurgadinb", "timorous", "timorousfalls", "tipt", "torgiran", "toskirakk", "towerofrot", "toxxulia", "trakanon", "trialsofsmoke", "tutoriala", "tutorialb", "twilight", "txevu", "umbral", "umbraltwo", "underquarry", "unkemptwoods", "unrest", "uqua", "valdeholm", "veeshan", "veeshantwo", "veksar", "velketor", "velketortwo", "vergalid", "vexthal", "vexthaltwo", "vxed", "wakening", "wallofslaughter", "warrens", "warslikswood", "weddingchapel", "weddingchapeldark", "well", "westkorlach", "westkorlacha", "westkorlachb", "westkorlachc", "westsepulcher", "westwastes", "westwastestwo", "windsong", "xorbb", "yxtta", "zhisza" };
std::error_code ec;
std::stringstream jParse;
json MeshDatabase = json::array();
Expand Down Expand Up @@ -429,7 +429,7 @@ int Curl_Progress_Report(void* ptr, double TotalToDownload, double NowDownloaded
{
return 0;
}
int progress = (int)round(NowDownloaded * 100 / TotalToDownload);
double progress = round(NowDownloaded * 100 / TotalToDownload);
MeshWriteChat(fmt::format("\ag[\atThread\aw: {}\ag] \awDownload of\ay {} \awis\at {}%\aw complete.", pm->Thread, pm->FileName, std::to_string(progress)), true);

fProgressDL = progress;
Expand Down Expand Up @@ -593,7 +593,7 @@ class MQ2MeshManagerType : public MQ2Type
Dest.Type = mq::datatypes::pStringType;
return true;
case DownloadProgress:
Dest.Int = fProgressDL;
Dest.Double = fProgressDL;
Dest.Type = mq::datatypes::pIntType;
return true;
case DownloadPath:
Expand Down Expand Up @@ -1198,7 +1198,7 @@ void MeshManagerUpdateAll(const char* Param2, const char* Param3) {
{
if (mq::ci_equals(Param3, "overwrite"))
{
for (int i = 0; i <= MaxZone - 1; i++)
for (int i = 0; i < MaxZone; i++)
{
zn = Zones[i];
tmp.FileName = zn + ".navmesh";
Expand All @@ -1209,7 +1209,7 @@ void MeshManagerUpdateAll(const char* Param2, const char* Param3) {
fDownloadReady = true;
return;
}
for (int i = 0; i <= MaxZone - 1; i++)
for (int i = 0; i < MaxZone; i++)
{
zn = Zones[i];
fs::path tp = NavPath / fmt::format("{}{}", zn, ".navmesh");
Expand Down Expand Up @@ -1833,7 +1833,7 @@ PLUGIN_API void OnUpdateImGui()
ImGui::Text("Select To Remove");
if (ImGui::ListBoxHeader("Ignores", ImVec2(0, 0)))
{
for (auto i : IgnoreList)
for (auto &i : IgnoreList)
{
if (i != "0")
{
Expand Down
8 changes: 4 additions & 4 deletions MQ2MeshManager.rc
Expand Up @@ -51,8 +51,8 @@ END
//

VS_VERSION_INFO VERSIONINFO
FILEVERSION 2,1
PRODUCTVERSION 2,1
FILEVERSION 2,2
PRODUCTVERSION 2,2
FILEFLAGSMASK 0x3fL
#ifdef _DEBUG
FILEFLAGS 0x1L
Expand All @@ -73,11 +73,11 @@ BEGIN
#else
VALUE "FileDescription", "MQ2MeshManager Release Version"
#endif
VALUE "FileVersion", "2.1"
VALUE "FileVersion", "2.2"
VALUE "InternalName", "MQ2MeshManager.dll"
VALUE "OriginalFilename", "MQ2MeshManager.dll"
VALUE "ProductName", "MQ2MeshManager"
VALUE "ProductVersion", "2.1"
VALUE "ProductVersion", "2.2"
END
END
BLOCK "VarFileInfo"
Expand Down

0 comments on commit 24e8d19

Please sign in to comment.