diff --git a/src/endWeek/nextWeek/nextWeek.js b/src/endWeek/nextWeek/nextWeek.js index 68b4cb1339e96d1766f8923d3c185dbb5aff8b52..768b530f525a3ac65ed611428493d6e757b3a6bc 100644 --- a/src/endWeek/nextWeek/nextWeek.js +++ b/src/endWeek/nextWeek/nextWeek.js @@ -115,9 +115,6 @@ App.EndWeek.nextWeek = function() { } } for (const slave of V.slaves) { - if (slave.hasOwnProperty("curBabies")) { - delete slave.curBabies; - } ageSlaveWeeks(slave); if (slave.indenture > 0) { slave.indenture -= 1; @@ -337,53 +334,7 @@ App.EndWeek.nextWeek = function() { V.pit.fought = false; } - App.EndWeek.resetUndocumentedGlobals(); - - // Other arrays - V.events = []; - V.RESSevent = []; - V.RESSTRevent = []; - V.RETSevent = []; - V.RECIevent = []; - V.RecETSevent = []; - V.REFIevent = []; - V.REFSevent = []; - V.PESSevent = []; - V.PETSevent = []; - V.FSAcquisitionEvents = []; - V.FSNonconformistEvents = []; - V.REAnalCowgirlSubIDs = []; - V.REButtholeCheckinIDs = []; - V.recruit = []; - V.RETasteTestSubIDs = []; - V.rebelSlaves = []; - V.REBoobCollisionSubIDs = []; - V.REIfYouEnjoyItSubIDs = []; - V.RESadisticDescriptionSubIDs = []; - V.REShowerForceSubIDs = []; - V.RECockmilkInterceptionIDs = []; - V.REInterslaveBeggingIDs = []; - V.eligibleSlaves = []; - - // Slave Objects using 0 instead of null. Second most memory eaten up. - V.activeSlave = 0; - V.eventSlave = 0; - V.subSlave = 0; - V.milkTap = 0; - V.relation = 0; - V.relative = 0; - V.relative2 = 0; - - // Slave Objects that never get zeroed so null them here. Second most memory eaten up. - V.beforeGingering = null; - - // Strings Memory varies. - V.buyer = ""; - V.desc = ""; - V.event = ""; - V.goto = ""; - V.malefactor = ""; - // Done with zeroing out, what should be for the most part Temps + App.EndWeek.resetGlobals(); if (V.autosave !== 0) { Save.autosave.save("Week Start Autosave"); diff --git a/src/endWeek/nextWeek/resetGlobals.js b/src/endWeek/nextWeek/resetGlobals.js new file mode 100644 index 0000000000000000000000000000000000000000..20e0fb51dad53c00688790aea656a2305df7b0ea --- /dev/null +++ b/src/endWeek/nextWeek/resetGlobals.js @@ -0,0 +1,80 @@ +/** + * These are variables that either should be made into temp vars or should be Zeroed out once done with them instead of here. This can also interfere with debugging or hide NaN's as zeroing things out would clear a NaN. Also could stop from NaN's getting worse? + */ +App.EndWeek.resetGlobals = function() { + // Integer and float variables. No real need to zero them out but doesn't hurt to have them in a known state, though this might mask variables NaN'ing out. Takes up the least amount of Memory besides a "" string. + V.i = 0; + V.j = 0; + V.averageProsperity = 0; + V.motherSlave = -1; + V.daughterSlave = -1; + V.devMother = -1; + V.devDaughter = -1; + V.alphaTwin = -1; + V.betaTwin = -1; + V.youngerSister = -1; + V.olderSister = -1; + V.boobsID = -1; + V.boobsInterestTargetID = -1; + V.buttslutID = -1; + V.buttslutInterestTargetID = -1; + V.cumslutID = -1; + V.cumslutInterestTargetID = -1; + V.humiliationID = -1; + V.humiliationInterestTargetID = -1; + V.sadistID = -1; + V.sadistInterestTargetID = -1; + V.masochistID = -1; + V.masochistInterestTargetID = -1; + V.domID = -1; + V.dominantInterestTargetID = -1; + V.subID = -1; + V.submissiveInterestTargetID = -1; + V.shelterGirlID = -1; + + // Other arrays + V.events = []; + V.RESSevent = []; + V.RESSTRevent = []; + V.RETSevent = []; + V.RECIevent = []; + V.RecETSevent = []; + V.REFIevent = []; + V.REFSevent = []; + V.PESSevent = []; + V.PETSevent = []; + V.FSAcquisitionEvents = []; + V.FSNonconformistEvents = []; + V.REAnalCowgirlSubIDs = []; + V.REButtholeCheckinIDs = []; + V.recruit = []; + V.RETasteTestSubIDs = []; + V.rebelSlaves = []; + V.REBoobCollisionSubIDs = []; + V.REIfYouEnjoyItSubIDs = []; + V.RESadisticDescriptionSubIDs = []; + V.REShowerForceSubIDs = []; + V.RECockmilkInterceptionIDs = []; + V.REInterslaveBeggingIDs = []; + V.eligibleSlaves = []; + + // Slave Objects using 0 instead of null. Second most memory eaten up. + V.activeSlave = 0; + V.eventSlave = 0; + V.subSlave = 0; + V.milkTap = 0; + V.relation = 0; + V.relative = 0; + V.relative2 = 0; + + // Slave Objects that never get zeroed so null them here. Second most memory eaten up. + V.beforeGingering = null; + + // Strings Memory varies. + V.buyer = ""; + V.desc = ""; + V.event = ""; + V.goto = ""; + V.malefactor = ""; + // Done with zeroing out, what should be for the most part Temps +}; diff --git a/src/endWeek/nextWeek/resetUndocumentedGlobals.js b/src/endWeek/nextWeek/resetUndocumentedGlobals.js deleted file mode 100644 index 544ae22f3b1fe43ed802f7c9ff5cfb3f3cceeafc..0000000000000000000000000000000000000000 --- a/src/endWeek/nextWeek/resetUndocumentedGlobals.js +++ /dev/null @@ -1,32 +0,0 @@ -App.EndWeek.resetUndocumentedGlobals = function() { - /* These are variables that either should be made into temp vars or should be Zeroed out once done with them instead of here. This can also interfere with debugging or hide NaN's as zeroing things out would clear a NaN. Also could stop from NaN's getting worse? */ - /* Integer and float variables. No real need to zero them out but doesn't hurt to have them in a known state, though this might mask variables NaN'ing out. Takes up the least amount of Memory besides a "" string. */ - V.i = 0; - V.j = 0; - V.averageProsperity = 0; - V.motherSlave = -1; - V.daughterSlave = -1; - V.devMother = -1; - V.devDaughter = -1; - V.alphaTwin = -1; - V.betaTwin = -1; - V.youngerSister = -1; - V.olderSister = -1; - V.boobsID = -1; - V.boobsInterestTargetID = -1; - V.buttslutID = -1; - V.buttslutInterestTargetID = -1; - V.cumslutID = -1; - V.cumslutInterestTargetID = -1; - V.humiliationID = -1; - V.humiliationInterestTargetID = -1; - V.sadistID = -1; - V.sadistInterestTargetID = -1; - V.masochistID = -1; - V.masochistInterestTargetID = -1; - V.domID = -1; - V.dominantInterestTargetID = -1; - V.subID = -1; - V.submissiveInterestTargetID = -1; - V.shelterGirlID = -1; -} \ No newline at end of file