Skip to content

Commit

Permalink
Merge branch 'dev' of https://github.com/Toby222/SharkGame into dev
Browse files Browse the repository at this point in the history
  • Loading branch information
stampyzfanz committed Jan 25, 2024
2 parents 68fab0d + 398aa51 commit 3bd242c
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/aspecttree.ts
Original file line number Diff line number Diff line change
Expand Up @@ -220,7 +220,7 @@ SharkGame.AspectTree = {

$.each(SharkGame.Aspects, (aspectId, aspectData) => {
const reqref = tree.requirementReference[aspectId];
if (!reqref.revealed) return;
if (!reqref || !reqref.revealed) return;

let basicText = "";
let cantBuyText = "";
Expand Down
8 changes: 8 additions & 0 deletions src/util.ts
Original file line number Diff line number Diff line change
Expand Up @@ -514,6 +514,14 @@ SharkGame.MiscUtil = {
if (obj instanceof HTMLAllCollection) {
return obj;
}
if (obj instanceof Node) {
console.warn(
"deepClone called with Node. " +
"This would cause unintended side-effects (e.g. missing event listeners). " +
"So we'll just return the object unchanged."
);
return obj;
}
switch (typeof obj) {
// Immutable types
case "bigint":
Expand Down
4 changes: 2 additions & 2 deletions src/world.ts
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,8 @@ SharkGame.World = {

// enable resources allowed on the planet
if (worldInfo.includedResources) {
SharkGame.ResourceMap.forEach((resource) => {
resource.exists = false;
SharkGame.ResourceMap.forEach((_resourceData, resourceName) => {
worldResources.get(resourceName).exists = false;
});
_.each(worldInfo.includedResources, (group) => {
if (sharkmisc.has(SharkGame.InternalCategories, group)) {
Expand Down

0 comments on commit 3bd242c

Please sign in to comment.