@rpg-engine/long-bow 0.6.73 → 0.6.75

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -32109,29 +32109,40 @@ var QuestList = function QuestList(_ref) {
32109
32109
  };
32110
32110
  // Updated helper function to format objectives
32111
32111
  var formatObjectives = function formatObjectives(objectives) {
32112
- return objectives.map(function (objective) {
32113
- if ('killCountTarget' in objective) {
32114
- // This is an IQuestObjectiveKill
32115
- var killObjective = objective;
32116
- return "Kill " + formatText(killObjective.creatureKeys.join(', ')) + ": " + killObjective.killCount + "/" + killObjective.killCountTarget;
32117
- } else if ('targetNPCkey' in objective) {
32118
- var _interactionObjective;
32119
- // This is an IQuestObjectiveInteraction
32120
- var interactionObjective = objective;
32121
- return "Interact with NPC: " + formatText((_interactionObjective = interactionObjective.targetNPCkey) != null ? _interactionObjective : 'Unknown');
32122
- } else {
32123
- return 'Unknown objective';
32124
- }
32125
- }).join('; ');
32112
+ try {
32113
+ if (!objectives || !Array.isArray(objectives)) return 'No objectives';
32114
+ return objectives.map(function (objective) {
32115
+ if ('killCountTarget' in objective) {
32116
+ var _killObjective$creatu, _killObjective$creatu2, _killObjective$killCo, _killObjective$killCo2;
32117
+ var killObjective = objective;
32118
+ return "Kill " + formatText((_killObjective$creatu = (_killObjective$creatu2 = killObjective.creatureKeys) == null ? void 0 : _killObjective$creatu2.join(', ')) != null ? _killObjective$creatu : 'Unknown') + ": " + ((_killObjective$killCo = killObjective.killCount) != null ? _killObjective$killCo : 0) + "/" + ((_killObjective$killCo2 = killObjective.killCountTarget) != null ? _killObjective$killCo2 : 0);
32119
+ } else if ('targetNPCkey' in objective) {
32120
+ var _interactionObjective;
32121
+ var interactionObjective = objective;
32122
+ return "Interact with NPC: " + formatText((_interactionObjective = interactionObjective.targetNPCkey) != null ? _interactionObjective : 'Unknown');
32123
+ } else {
32124
+ return 'Unknown objective';
32125
+ }
32126
+ }).join('; ');
32127
+ } catch (error) {
32128
+ console.error('Error formatting objectives:', error);
32129
+ return 'Error formatting objectives';
32130
+ }
32126
32131
  };
32127
32132
  // Updated helper function to format rewards
32128
32133
  var formatRewards = function formatRewards(rewards) {
32129
- if (!rewards) return 'No rewards';
32130
- return rewards.map(function (reward) {
32131
- return "" + formatText(reward.itemKeys.map(function (itemKey) {
32132
- return itemKey + ' x' + reward.qty;
32133
- }).join(', ')) + (reward.spellKeys ? ", Spells: " + formatText(reward.spellKeys.join(', ')) : '');
32134
- }).join('; ');
32134
+ try {
32135
+ if (!rewards || !Array.isArray(rewards)) return 'No rewards';
32136
+ return rewards.map(function (reward) {
32137
+ var _reward$itemKeys;
32138
+ return "" + formatText(reward == null ? void 0 : (_reward$itemKeys = reward.itemKeys) == null ? void 0 : _reward$itemKeys.map(function (itemKey) {
32139
+ return itemKey + ' x' + (reward == null ? void 0 : reward.qty);
32140
+ }).join(', ')) + (reward != null && reward.spellKeys ? ", Spells: " + formatText(reward.spellKeys.join(', ')) : '');
32141
+ }).join('; ');
32142
+ } catch (error) {
32143
+ console.error("Error formatting rewards: " + JSON.stringify(rewards) + ":", error);
32144
+ return 'Error on rewards';
32145
+ }
32135
32146
  };
32136
32147
  var formatText = function formatText(text) {
32137
32148
  return text.split('-').map(function (word) {