From 7756e139fffafcebea854c4eeff1e99a445a9add Mon Sep 17 00:00:00 2001 From: kopareigns <kopareigns@gmail.com> Date: Sun, 15 Apr 2018 16:07:44 -0400 Subject: [PATCH] Checks and Fixes --- src/uncategorized/BackwardsCompatibility.tw | 12 +++++++++++ src/uncategorized/pUndergroundRailroad.tw | 3 ++- src/uncategorized/reFormerAbolitionist.tw | 2 +- src/uncategorized/recETS.tw | 2 ++ src/uncategorized/rename.tw | 1 + src/uncategorized/saLongTermEffects.tw | 22 +++++++++++---------- src/uncategorized/saServeThePublic.tw | 6 +++--- src/uncategorized/saWhore.tw | 6 +++--- src/uncategorized/seRetirement.tw | 1 + 9 files changed, 37 insertions(+), 18 deletions(-) diff --git a/src/uncategorized/BackwardsCompatibility.tw b/src/uncategorized/BackwardsCompatibility.tw index 7efd5afc912..59c223d07cf 100644 --- a/src/uncategorized/BackwardsCompatibility.tw +++ b/src/uncategorized/BackwardsCompatibility.tw @@ -2358,6 +2358,18 @@ Setting missing slave variables: <<if ndef _Slave.canRecruit>> <<set _Slave.canRecruit = 0>> <</if>> +<<if _Slave.rivalry != 0>> + <<set _backwardsCompatibility = $slaveIndices[_Slave.rivalryTarget]>> + <<if ndef _backwardsCompatibility>><<set _Slave.rivalry = 0, _Slave.rivalryTarget = 0>><</if>> +<</if>> +<<if _Slave.relationship > 0>> + <<set _backwardsCompatibility = $slaveIndices[_Slave.relationshipTarget]>> + <<if ndef _backwardsCompatibility>><<set _Slave.relationship = 0, _Slave.relationshipTarget = 0>><</if>> +<</if>> +<<if $familyTesting == 0 && _Slave.relation != 0>> + <<set _backwardsCompatibility = $slaveIndices[_Slave.relationTarget]>> + <<if ndef _backwardsCompatibility>><<set _Slave.relation = 0, _Slave.relationTarget = 0>><</if>> +<</if>> <<if ndef _Slave.buttplugAttachment>> <<set _Slave.buttplugAttachment = "none">> <</if>> diff --git a/src/uncategorized/pUndergroundRailroad.tw b/src/uncategorized/pUndergroundRailroad.tw index 75a83342985..84379644fcd 100644 --- a/src/uncategorized/pUndergroundRailroad.tw +++ b/src/uncategorized/pUndergroundRailroad.tw @@ -94,7 +94,8 @@ that several nondescript citizens she sees occasionally at work have passed a fe You calmly inform her that she's free to go. She almost collapses with shock, but turns and hurries out of the arcology, tears streaming from her eyes. She wanders down through the arcology, attracting little notice. One moment the monitors have her struggling through a dense-packed crowd, and the next, they don't. <<if $activeSlave.relationship > 0>> <<set $i = $slaveIndices[$activeSlave.relationshipTarget]>> - <<set $activeSlave.relationshipTarget = 0, $activeSlave.relationship = 0, $slaves[$i].relationshipTarget = 0, $slaves[$i].relationship = 0>> + <<set $activeSlave.relationshipTarget = 0, $activeSlave.relationship = 0>> + <<if def $i>><<set $slaves[$i].relationshipTarget = 0, $slaves[$i].relationship = 0>><<else>>@@.red;Error, relationshipTarget not found.@@<</if>> <</if>> <<set $traitor = $activeSlave>> <<set $traitorStats = {PCpregSource: 0, PCmother: 0, PCfather: 0, traitorMother: [], traitorFather: [], traitorPregSources: [], traitorMotherTank: [], traitorFatherTank: []}>> diff --git a/src/uncategorized/reFormerAbolitionist.tw b/src/uncategorized/reFormerAbolitionist.tw index d69e8482c64..44b1ede9b3f 100644 --- a/src/uncategorized/reFormerAbolitionist.tw +++ b/src/uncategorized/reFormerAbolitionist.tw @@ -7,7 +7,7 @@ <<set $returnTo = "RIE Eligibility Check">> <<if $legendaryFacility == 1>> - <<set $activeSlave = $slaves[$slaveIndices[$legendaryAbolitionistID]]>> + <<set $activeSlave = getSlave($legendaryAbolitionistID)>> <<else>> <<set $activeSlave = $eventSlave>> <</if>> diff --git a/src/uncategorized/recETS.tw b/src/uncategorized/recETS.tw index 8f33e8f8bc4..32c2ae0fadd 100644 --- a/src/uncategorized/recETS.tw +++ b/src/uncategorized/recETS.tw @@ -909,6 +909,8 @@ This call is coming from a public kiosk, which is usually an indication that the <<set $activeSlave.father = 0>> <<set $activeSlave.relation = 0>> <<set $activeSlave.relationTarget = 0>> + <<set $activeSlave.rivalry = 0>> + <<set $activeSlave.rivalryTarget = 0>> <<AddSlave $activeSlave>> <<set $cash -= $contractCost>> <<replace "#result">> diff --git a/src/uncategorized/rename.tw b/src/uncategorized/rename.tw index 7b76964abd7..0a6194ce535 100644 --- a/src/uncategorized/rename.tw +++ b/src/uncategorized/rename.tw @@ -75,6 +75,7 @@ <<if $oldSurname != $activeSlave.slaveSurname>> <<if $activeSlave.relationship >= 5>> <<set _i = $slaveIndices[$activeSlave.relationshipTarget]>> + <<if ndef _i>>@@.red;Error, relationshipTarget not found.@@<</if>> <<if $slaves[_i].slaveSurname>> <<if $activeSlave.slaveSurname == $slaves[_i].slaveSurname>> She's touched that she now shares a surname with her wife $slaves[_i].slaveName $slaves[_i].slaveSurname, and is @@.mediumaquamarine;more confident than ever@@ that you intend to keep them together in marital bliss. diff --git a/src/uncategorized/saLongTermEffects.tw b/src/uncategorized/saLongTermEffects.tw index a057b1c55dd..337e86ca65f 100644 --- a/src/uncategorized/saLongTermEffects.tw +++ b/src/uncategorized/saLongTermEffects.tw @@ -4357,15 +4357,16 @@ <<default>> /* random impregnation chance on other assignments - consider relationships first */ <<if (_conceptionSeed > 80) && (($slaves[$i].vaginalCount > 0) || ($slaves[$i].analCount > 0 && $slaves[$i].mpreg > 0))>> /* TODO: compare to previous week totals? */ - <<for _m = 0; _m < $slaves.length; _m++>> - <<if $slaves[$i].relationshipTarget > 0>> - <<set _tempLover = getSlave($slaves[$i].relationshipTarget)>> - <<elseif $slaves[$i].rivalryTarget > 0>> - <<set _tempRival = getSlave($slaves[$i].rivalryTarget)>> - <<elseif $slaves[$i].subTarget > 0>> - <<set _tempSub = getSlave($slaves[$i].subTarget)>> - <</if>> - <</for>> + <<if $slaves[$i].relationshipTarget > 0>> + <<set _tempLover = getSlave($slaves[$i].relationshipTarget)>> + <<if ndef _tempLover>>@@.red;Error, relationshipTarget not found.@@<</if>> + <<elseif $slaves[$i].rivalryTarget > 0>> + <<set _tempRival = getSlave($slaves[$i].rivalryTarget)>> + <<if ndef _tempRival>>@@.red;Error, rivalryTarget not found.@@<</if>> + <<elseif $slaves[$i].subTarget > 0>> + <<set _tempSub = getSlave($slaves[$i].subTarget)>> + <<if ndef _tempSub>>@@.red;Error, subTarget not found.@@<</if>> + <</if>> <<if ($PC.dick == 1) && (($slaves[$i].relationship == -3) || ($slaves[$i].relationship == -2)) && ($slaves[$i].eggType == "human")>> <<set $slaves[$i].pregSource = -1>> <<elseif ($slaves[$i].relationship > 2) && canImpreg($slaves[$i], _tempLover)>> /* erection not needed for impregnation via consensual sex play (FWB or better) */ @@ -5002,7 +5003,8 @@ <</if>> <<else>> <<if $slaves[$i].pregKnown == 1 && $slaves[$i].pregSource > 0>> - <<set _lte = getSlave($slaves[$i].pregSource)>> + <<set _lte = $slaveIndices[$slaves[$i].pregSource]>> + <<if ndef _lte>>@@.red;Error, pregSource not found.@@<</if>> <<if $slaves[_lte].race == $arcologies[0].FSSubjugationistRace>> Society @@.red;strongly disapproves@@ of your allowing $slaves[$i].slaveName to be miscegenated by a $arcologies[0].FSSubjugationistRace subhuman like $slaves[_lte].slaveName. <<FSChangePorn "Subjugationist" -2>> diff --git a/src/uncategorized/saServeThePublic.tw b/src/uncategorized/saServeThePublic.tw index 5f7cc778250..2446e8dea4b 100644 --- a/src/uncategorized/saServeThePublic.tw +++ b/src/uncategorized/saServeThePublic.tw @@ -495,7 +495,7 @@ Her appearance attracted $beauty members of the public (<<print Math.trunc($beau <<else>> <<if $slaves[$i].relation != 0>> <<set $j = $slaveIndices[$slaves[$i].relationTarget]>> - <<if $slaves[$j].assignment == $slaves[$i].assignment>> + <<if def $j && $slaves[$j].assignment == $slaves[$i].assignment>> Since her $slaves[$j].relation $slaves[$j].slaveName is a public slut too, she earns extra attention. <<if $arcologies[0].FSEgyptianRevivalist > 20>> Citizens are very excited about being able to participate in incestuous sex like the ancient Egyptians. @@ -507,7 +507,7 @@ Her appearance attracted $beauty members of the public (<<print Math.trunc($beau <</if>> <<if $slaves[$i].relationship > 0>> <<set $j = $slaveIndices[$slaves[$i].relationshipTarget]>> - <<if $slaves[$j].assignment == $slaves[$i].assignment>> + <<if def $j && $slaves[$j].assignment == $slaves[$i].assignment>> Her <<if $slaves[$j].relationship <= 1>> friend @@ -527,7 +527,7 @@ Her appearance attracted $beauty members of the public (<<print Math.trunc($beau <</if>> <<if $slaves[$i].rivalry != 0>> <<set $j = $slaveIndices[$slaves[$i].rivalryTarget]>> - <<if $slaves[$j].assignment == $slaves[$i].assignment>> + <<if def $j && $slaves[$j].assignment == $slaves[$i].assignment>> She's a little less effective due to her mutual dislike with $slaves[$j].slaveName. <</if>> <</if>> diff --git a/src/uncategorized/saWhore.tw b/src/uncategorized/saWhore.tw index 0ffcf9444ba..482b9965bd2 100644 --- a/src/uncategorized/saWhore.tw +++ b/src/uncategorized/saWhore.tw @@ -497,7 +497,7 @@ Her appearance attracted $beauty customers (<<print Math.trunc($beauty/7)>> a da <<else>> <<if $slaves[$i].relation != 0>> <<set $j = $slaveIndices[$slaves[$i].relationTarget]>> - <<if $slaves[$j].assignment == $slaves[$i].assignment>> + <<if def $j && $slaves[$j].assignment == $slaves[$i].assignment>> Since her $slaves[$j].relation $slaves[$j].slaveName is selling herself too, she earns extra ¤ by working with her. <<if $arcologies[0].FSEgyptianRevivalist > 20>> Customers are very enthusiastic about being able to participate in incestuous sex like the ancient Egyptians. @@ -509,7 +509,7 @@ Her appearance attracted $beauty customers (<<print Math.trunc($beauty/7)>> a da <</if>> /*closes extended family mode */ <<if $slaves[$i].relationship > 0>> <<set $j = $slaveIndices[$slaves[$i].relationshipTarget]>> - <<if $slaves[$j].assignment == $slaves[$i].assignment>> + <<if def $j && $slaves[$j].assignment == $slaves[$i].assignment>> Her <<if $slaves[$j].relationship <= 1>> friend @@ -529,7 +529,7 @@ Her appearance attracted $beauty customers (<<print Math.trunc($beauty/7)>> a da <</if>> <<if $slaves[$i].rivalry != 0>> <<set $j = $slaveIndices[$slaves[$i].rivalryTarget]>> - <<if $slaves[$j].assignment == $slaves[$i].assignment>> + <<if def $j && $slaves[$j].assignment == $slaves[$i].assignment>> She earns a little less ¤ due to bickering with $slaves[$j].slaveName. <</if>> <</if>> diff --git a/src/uncategorized/seRetirement.tw b/src/uncategorized/seRetirement.tw index e14ae7838d0..00af41c7c72 100644 --- a/src/uncategorized/seRetirement.tw +++ b/src/uncategorized/seRetirement.tw @@ -20,6 +20,7 @@ in a way that will fill the rest of your property with envy and @@.mediumaquamar <</for>> <<if $activeSlave.relationship > 3>> <<set _sr = $slaveIndices[$activeSlave.relationshipTarget]>> + <<if ndef _sr>>@@.red;Error, relationshipTarget not found.@@<</if>> $slaves[_sr].slaveName, for her part, is @@.hotpink;overjoyed,@@ though also a bit sad. She looks forward to joining $activeSlave.slaveName one day. <<set $slaves[_sr].devotion += 10>> <</if>> -- GitLab