diff --git a/FCHost/fchost/fchost_storage.cc b/FCHost/fchost/fchost_storage.cc index 666d9e6700f18bf25198e983b37c0b3bb1ed77b5..9ee70b298d69772378ab902ad891176b25a06af6 100644 --- a/FCHost/fchost/fchost_storage.cc +++ b/FCHost/fchost/fchost_storage.cc @@ -106,7 +106,15 @@ void FCHostPersistentStorage::load() readbuf[entrySize + 1] = readbuf[entrySize] = 0; // null terminate CefString val; val.FromString16(static_cast<const char16_t*>(static_cast<const void*>(readbuf.data()))); - storage.emplace(entry.path().filename().native(), CefV8Value::CreateString(val)); + auto sKey = entry.path().filename().native(); +#if defined(OS_WIN) + // put the fucking colon back in it + const size_t loc = sKey.find(L'#', 0); + if (loc != std::wstring::npos) { + sKey.replace(loc, static_cast<size_t>(1), L":"); + } +#endif + storage.emplace(sKey, CefV8Value::CreateString(val)); } } } @@ -115,7 +123,13 @@ void FCHostPersistentStorage::load() fs::path FCHostPersistentStorage::get_filename(const CefString& key) const { #if defined (OS_WIN) - return path / key.ToWString(); + std::wstring sKey = key.ToWString(); + // some fool decided to use a fucking colon as a key separator for SC V3 saves...can't have that in a filename on windows... + const size_t loc = sKey.find(L':', 0); + if (loc != std::wstring::npos) { + sKey.replace(loc, static_cast<size_t>(1), L"#"); + } + return path / sKey; #else return path / key.ToString(); #endif diff --git a/src/js/economyJS.js b/src/js/economyJS.js index 9b1984d5cd8069a48d8c58fbb569b21e243554c9..8a4d94f39423cec3032e9280773fb63ca697fcb5 100644 --- a/src/js/economyJS.js +++ b/src/js/economyJS.js @@ -2157,13 +2157,14 @@ globalThis.slaveJobValues = function(lowerClassSexDemandRef, middleClassSexDeman // Injuries if (s.assignment === Job.WHORE && !toTheBrothel) { + let setInjury = false; if (s.curatives < 1 && s.inflationType !== "curative") { if (s.health.condition < -50) { healthDamage(s, 13); - s.minorInjury = 1; + setInjury = true; } else if (s.health.condition < -20 && jsRandom(1, 100) > 50) { healthDamage(s, 10); - s.minorInjury = 1; + setInjury = true; } else { const canA = canDoAnal(s) ? 1 : 0; const canV = canDoVaginal(s) ? 1 : 0; @@ -2178,11 +2179,11 @@ globalThis.slaveJobValues = function(lowerClassSexDemandRef, middleClassSexDeman if (jsRandom(1, 100) > skilltarget) { healthDamage(s, 10 - 7 * canA * (canV | canP)); // Any limitations means an injury inflicts the harsher 10 instead of 3 - s.minorInjury = 1; + setInjury = true; } } } - if (s.minorInjury === 1) { + if (setInjury) { const injuryChance = canDoAnal(s) ? jsRandom(1, 100) : jsRandom(1, 80); beautyMultiplier -= 0.05; diff --git a/src/js/utilsPC.js b/src/js/utilsPC.js index 2188711a3c88ca24569c203581f0f0e7a88a7716..1a95bd1e50d1f46f8faca5bf01fb076f3faca1e9 100644 --- a/src/js/utilsPC.js +++ b/src/js/utilsPC.js @@ -1170,8 +1170,8 @@ globalThis.isPlayerFrigid = function() { * * 101+: life ruining rumors * @param {"penetrative" | "birth" | "weakness" | "all"} rumorType * @returns {number} - */ - globalThis.getRumors = function(rumorType = "all") { + */ +globalThis.getRumors = function(rumorType = "all") { let result = { penetrative: V.PC.badRumors.penetrative, birth: V.PC.badRumors.birth, @@ -1180,7 +1180,7 @@ globalThis.isPlayerFrigid = function() { if (V.PC.counter.raped > 0) { // rapes are everlasting weakness rumors result.weakness += Math.min(V.PC.counter.raped, 10); if (V.PC.counter.raped > 10) { - result.weakness + Math.sqrt(V.PC.counter.raped - 10); + result.weakness += Math.sqrt(V.PC.counter.raped - 10); } result.weakness = Math.floor(result.weakness); }