Activity Null Check Fix ()

This commit is contained in:
Nina-1474 2022-01-06 19:51:32 +00:00 committed by GitHub
parent 3ccd308c16
commit bcc67eabbf
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 8 additions and 8 deletions
BondageClub/Screens
Character/Preference
Inventory/ItemHands/SpankingToys

View file

@ -297,7 +297,7 @@ function PreferenceInit(C) {
// Validates the zones
for (let A = 0; A < AssetGroup.length; A++)
if ((AssetGroup[A].Zone != null) && (AssetGroup[A].Activity != null)) {
if ((AssetGroup[A].Zone != null) && AssetGroup[A].Activity.length) {
let Found = false;
for (let Z = 0; Z < C.ArousalSettings.Zone.length; Z++)
if ((C.ArousalSettings.Zone[Z] != null) && (C.ArousalSettings.Zone[Z].Name != null) && (AssetGroup[A].Name == C.ArousalSettings.Zone[Z].Name)) {
@ -1264,7 +1264,7 @@ function PreferenceSubscreenArousalRun() {
// Draws all the available character zones
for (let A = 0; A < AssetGroup.length; A++)
if ((AssetGroup[A].Zone != null) && (AssetGroup[A].Activity != null) && !AssetGroup[A].MirrorActivitiesFrom)
if ((AssetGroup[A].Zone != null) && AssetGroup[A].Activity.length && !AssetGroup[A].MirrorActivitiesFrom)
DrawAssetGroupZone(Player, AssetGroup[A].Zone, 0.9, 50, 50, 1, "#808080FF", 3, PreferenceGetFactorColor(PreferenceGetZoneFactor(Player, AssetGroup[A].Name)));
// The zones can be selected and drawn on the character
@ -1759,7 +1759,7 @@ function PreferenceSubscreenArousalClick() {
// In arousal mode, the player can click on her zones
for (let A = 0; A < AssetGroup.length; A++)
if ((AssetGroup[A].Zone != null) && (AssetGroup[A].Activity != null) && !AssetGroup[A].MirrorActivitiesFrom)
if ((AssetGroup[A].Zone != null) && AssetGroup[A].Activity.length && !AssetGroup[A].MirrorActivitiesFrom)
for (let Z = 0; Z < AssetGroup[A].Zone.length; Z++)
if (DialogClickedInZone(Player, AssetGroup[A].Zone[Z], 0.9, 50, 50, 1)) {
Player.FocusGroup = AssetGroup[A];

View file

@ -303,14 +303,14 @@ function InventorySpankingToysGetActivity(C) {
* @returns {boolean}
*/
function InventorySpankingToysActivityAllowed(C) {
var Type = InventorySpankingToysGetType(Player);
var A = AssetGet(C.AssetFamily, "ItemHands", "SpankingToys" + Type);
const Type = InventorySpankingToysGetType(Player);
const A = AssetGet(C.AssetFamily, "ItemHands", "SpankingToys" + Type);
if (InventoryBlockedOrLimited(C, { Asset: A }))
return false;
if (C.FocusGroup != null) {
var Activity = InventorySpankingToysGetActivity(Player);
const Activity = InventorySpankingToysGetActivity(Player);
if (Activity == null) return true;
if (C.FocusGroup.Activity != null) return C.FocusGroup.Activity.indexOf(Activity) >= 0;
else return C.FocusGroup.Activity.includes(Activity);
}
return false;
}
@ -333,4 +333,4 @@ function InventorySpankingToysGetAudio(C) {
case "CattleProd": return "Shocks";
default: return "";
}
}
}