Actually fixed the bug this time

This commit is contained in:
Deukhoofd 2016-05-21 20:53:44 +02:00
parent 206021f0c7
commit df9cfe99d8
3 changed files with 9 additions and 4 deletions

File diff suppressed because one or more lines are too long

View File

@ -4188,7 +4188,7 @@
"Petal Dance",
"Boomburst",
"Roost",
"Grass Whistle",
"GrassWhistle",
"Flash Cannon",
"Mega Drain"
]
@ -4312,7 +4312,7 @@
"Petal Dance",
"Boomburst",
"Roost",
"Grass Whistle",
"GrassWhistle",
"Flash Cannon",
"Mega Drain"
]

View File

@ -10,7 +10,7 @@ UberCount = 0
PUCount = 0
UnreleasedCount = 0
DeltaCount = 0
generation = ""
createTeamBookshelf = (format, requs, next) ->
createTeam format, requs, (mons, teamname) ->
@ -201,6 +201,11 @@ generateMoves = (possibleMoves) ->
if movesArr.length < 4
moveIndex = Math.floor(Math.random() * (possibleMoves.length))
movename = possibleMoves[moveIndex]
moveobj = gen.GenerationJSON[generation].MoveData[movename]
if typeof moveobj == "undefined" and !(/Hidden Power/.test(movename))
console.log(movename)
generateMove()
return
#We reject the move if it's not defined
if typeof movename == "undefined"
generateMove()