mirror of
https://github.com/codeninjasllc/codecombat.git
synced 2024-11-27 17:45:40 -05:00
Adds temporary hack for infinite loops in randomise
This commit is contained in:
parent
1790215fea
commit
f700ddea0c
1 changed files with 5 additions and 5 deletions
|
@ -316,15 +316,15 @@ module.exports = class TerrainRandomizeModal extends ModalView
|
|||
}
|
||||
|
||||
addThang: (thang) ->
|
||||
# if @falseCount > 20
|
||||
# console.log 'infinite loop', thang
|
||||
# @falseCount = 0
|
||||
# return true
|
||||
if @falseCount > 20
|
||||
console.log 'infinite loop', thang
|
||||
@falseCount = 0
|
||||
return true
|
||||
for existingThang in @thangs
|
||||
if existingThang.margin is -1 or thang.margin is -1
|
||||
continue
|
||||
if Math.abs(existingThang.pos.x - thang.pos.x) <= thang.margin + existingThang.margin and Math.abs(existingThang.pos.y - thang.pos.y) <= thang.margin + existingThang.margin
|
||||
# @falseCount++
|
||||
@falseCount++
|
||||
return false
|
||||
@thangs.push thang
|
||||
true
|
||||
|
|
Loading…
Reference in a new issue