diff --git a/app/lib/world/world.coffee b/app/lib/world/world.coffee index 23f7222fc..8dd139364 100644 --- a/app/lib/world/world.coffee +++ b/app/lib/world/world.coffee @@ -31,15 +31,13 @@ module.exports = class World @systemMap = {} @scriptNotes = [] # We want a seed thats not always 0 yet reproducable. - console.log "Seed: ", @getSeed() @rand = new Rand @getSeed() @frames = [new WorldFrame(@, 0)] getSeed: -> - return 0 unless @userCodeMap #TODO: When does this happen? #Packs all methods in all thangs in one big array, then sorts and joins them. Then returns a hash value of the result. @hashString((methods for thangID, methods of @userCodeMap).reduce(((ret, methods) -> - (method for methodID, method of methods).reduce(((ret, method) -> ret.push(method)), ret) + ret.push method for methodID, method of methods ), []).sort().join()) getFrame: (frameIndex) -> @@ -497,4 +495,4 @@ module.exports = class World #djb2 algorithm hashString: (str) -> - (str.charCodeAt i for i in [0...str]).reduce(((hash, char) -> ((hash << 5) + hash) + char), 5381) # hash * 33 + c + (str.charCodeAt i for i in [0...str.length]).reduce(((hash, char) -> ((hash << 5) + hash) + char), 5381) # hash * 33 + c