Changeset View
Changeset View
Standalone View
Standalone View
ps/trunk/binaries/data/mods/public/maps/random/rmbiome/randombiome.js
Show First 20 Lines • Show All 44 Lines • ▼ Show 20 Lines | function loadBiomeFile(file) | ||||
let path = "maps/random/rmbiome/" + file + ".json"; | let path = "maps/random/rmbiome/" + file + ".json"; | ||||
if (!Engine.FileExists(path)) | if (!Engine.FileExists(path)) | ||||
{ | { | ||||
error("Could not load biome file '" + file + "'"); | error("Could not load biome file '" + file + "'"); | ||||
return; | return; | ||||
} | } | ||||
let biome = Engine.ReadJSONFile(path) | let biome = Engine.ReadJSONFile(path); | ||||
let copyProperties = (from, to) => { | let copyProperties = (from, to) => { | ||||
for (let prop in from) | for (let prop in from) | ||||
{ | { | ||||
if (from[prop] !== null && typeof from[prop] == "object" && !Array.isArray(from[prop])) | if (from[prop] !== null && typeof from[prop] == "object" && !Array.isArray(from[prop])) | ||||
{ | { | ||||
if (!to[prop]) | if (!to[prop]) | ||||
to[prop] = {}; | to[prop] = {}; | ||||
Show All 28 Lines |
Wildfire Games · Phabricator