Skip to content

Commit

Permalink
Worlds can now omit missing and present resources
Browse files Browse the repository at this point in the history
  • Loading branch information
spencers145 committed Sep 14, 2024
1 parent 911786c commit cebb95a
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions js/gateway.js
Original file line number Diff line number Diff line change
Expand Up @@ -828,7 +828,7 @@ SharkGame.Gateway = {
switch (SharkGame.Aspects.distantForesight.level) {
case 1:
contentDiv.prepend($("<p>").html(worldData.foresight.longDesc));
if (worldData.foresight.missing.length > 0) {
if (worldData.foresight.missing && worldData.foresight.missing.length > 0) {
const missingList = $("<ul>").addClass("gatewayPropertyList");
_.each(worldData.foresight.missing, (missingResource) => {
missingList.append(
Expand All @@ -841,7 +841,7 @@ SharkGame.Gateway = {
});
contentDiv.prepend(missingList);
}
if (worldData.foresight.present.length > 0) {
if (worldData.foresight.present && worldData.foresight.present.length > 0) {
const presentList = $("<ul>").addClass("gatewayPropertyList");
_.each(worldData.foresight.present, (presentResource) => {
presentList.append(
Expand All @@ -860,7 +860,7 @@ SharkGame.Gateway = {
});
contentDiv.prepend(presentList);
}
if (worldData.modifiers.length > 0) {
if (worldData.modifiers && worldData.modifiers.length > 0) {
const modifierList = $("<ul>").addClass("gatewayPropertyList");
_.each(worldData.modifiers, (modifier) => {
if (gateway.playerHasSeenResource(modifier.resource) || !(worldData.foresight.present.indexOf(modifier.resource) > -1)) {
Expand Down

0 comments on commit cebb95a

Please sign in to comment.