Skip to content
Snippets Groups Projects
Commit e669f3f7 authored by Pregmodder's avatar Pregmodder
Browse files

Revert "Merge branch 'vas-lessloop' into 'pregmod-master'"

This reverts merge request !1794
parent 8f2ba0ec
No related branches found
No related tags found
No related merge requests found
......@@ -70,7 +70,7 @@ You should have received a copy of the GNU General Public License along with thi
<</if>>
<<set $slaves[_i].rivalry = 0, $slaves[_i].rivalryTarget = 0, $slaves[_i].subTarget = 0>>
<<else>>
<<set _dump = removeSlave(_i), _i--, _SL-->>
<<set _dump = $slaves.deleteAt(_i), _i--, _SL-->>
<</if>>
<</for>>
<<for _k = 0; _k < _SL; _k++>>
......@@ -240,7 +240,6 @@ You should have received a copy of the GNU General Public License along with thi
<<set $genePool = []>>
<</if>>
<<set $slaveIndices = slaves2indices()>>
<<set $organs = []>>
<<set $ArcadeiIDs = [], $BrothiIDs = [], $CellBiIDs = [], $CliniciIDs = [], $ClubiIDs = [], $DairyiIDs = [], $HGSuiteiIDs = [], $MastSiIDs = [], $SchlRiIDs = [], $ServQiIDs = [], $SpaiIDs = [], $FacSupIDs = []>>
......
......@@ -214,25 +214,3 @@ window.supremeRaceP = function supremeRaceP(slave) {
window.inferiorRaceP = function inferiorRaceP(slave) {
return State.variables.arcologies[0].FSSubjugationistRace === slave.race
}
window.addSlave = function addSlave(slave) {
State.variables.slaves.push(slave);
State.variables.slaveIndices[slave.id] = State.variables.slaves.length - 1;
};
window.removeSlave = function removeSlave(index) {
delete State.variables.slaveIndices[State.variables.slaves[index].id];
return State.variables.slaves.deleteAt(index);
};
window.slaves2indices = function slaves2indices() {
const obj = {};
State.variables.slaves.forEach((slave, i) => obj[slave.id] = i);
return obj;
};
window.getSlave = function getSlave(ID) {
const index = State.variables.slaveIndices[ID];
if (index === undefined) return null;
else return State.variables.slaves[State.variables.slaveIndices[ID]];
};
......@@ -143,7 +143,7 @@
<<set $limbs.deleteAt(_o)>>
<</if>>
<<set _dump = removeSlave(_x), _SL--, $activeSlave = 0>>
<<set _dump = $slaves.deleteAt(_x), _SL--, $activeSlave = 0>>
<<if _missingID == 1>>
<<set $missingParentID-->>
......
......@@ -1737,7 +1737,7 @@
<<set $REReductionCheckinIDs.push($args[0].ID)>>
<</if>>
<<run addSlave($args[0])>>
<<set $slaves.push($args[0])>>
<<if $args[0].origin != "She was your slave, but you freed her, which she repaid by participating in a coup attempt against you. It failed, and she is again your chattel.">>
<<set $genePool.push($args[0])>>
<<else>>
......@@ -2059,9 +2059,9 @@ This experience
<<set $args[0] = $args[0].sort(function(a, b){return b.devotion-a.devotion})>>
<</if>>
<</switch>>
<<set $slaveIndices = slaves2indices()>>
<<else>>
<<set $slaveIndices = slaves2indices()>>
<<set $slaveIndices = {}>>
<<set $slaves.forEach(function(s, i) { $slaveIndices[s.ID] = i; })>>
<<set filterInPlace($args[0], function(s) { return $slaveIndices[s] !== undefined; })>>
<<set $args[0].sort(function(a, b) { return $slaveIndices[a] - $slaveIndices[b]; })>>
<</if>>
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment