From 337eb83d47d3a9d93a3b9ff6e785af76142a9201 Mon Sep 17 00:00:00 2001 From: Mute Date: Fri, 11 Nov 2022 02:14:59 +0000 Subject: [PATCH] Update 'mbchc-local.user.js' /me grumbles --- mbchc-local.user.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/mbchc-local.user.js b/mbchc-local.user.js index 7cffcbe..b8ca18b 100644 --- a/mbchc-local.user.js +++ b/mbchc-local.user.js @@ -288,7 +288,7 @@ if (!window.ActivityAllowed()) throw "activities disabled in this room" if (!window.ServerChatRoomGetAllowItem(window.Player, char)) throw "no permissions" char.FocusGroup = this.ensure("invalid AssetGroup", () => window.AssetGroupGet(char.AssetFamily, ag)) - let activity = this.ensure("invalid activity", () => window.ActivityAllowedForGroup(char, char.FocusGroup.Name, true).find(a => a.Name === action || a.Activity.Name === action)) + let activity = this.ensure("invalid activity", () => window.ActivityAllowedForGroup(char, char.FocusGroup.Name, true).find(a => a.Name === action || a.Activity?.Name === action)) if ((activity.Name || activity.Activity.Name).endsWith("Item")) { const item = this.ensure("no toy found", () => window.Player.Inventory.find(i => i.Asset?.Name === "SpankingToys" && i.Asset.Group?.Name === char.FocusGroup.Name && window.AssetSpankingToys.DynamicActivity(char) === (activity.Name || activity.Activity.Name))) window.DialogPublishAction(char, item) @@ -426,7 +426,7 @@ let toy = window.InventoryGet(window.Player, "ItemHands") if (toy && toy.Asset.Name === "SpankingToys") available.push(window.AssetAllActivities(char.AssetFamily).find(a => a.Name === window.InventorySpankingToysGetActivity?.(window.Player))) let actions = mbchc.ensure(`zone "${zone}" invalid for ("${verb}" "${type}")`, () => types[type]) - let action = mbchc.ensure(`invalid action (${verb} ${zone} ${target})`, () => actions.find(name => available.find(a => a.Name === name || a.Activity.Name === name))) + let action = mbchc.ensure(`invalid action (${verb} ${zone} ${target})`, () => actions.find(name => available.find(a => a.Name === name || a.Activity?.Name === name))) mbchc.run_activity(char, ag, action) } catch (x) { mbchc.report(x) } }, bell: function() {