1
0
mirror of https://gitlab.com/Deukhoofd/BattleSim.git synced 2025-09-02 00:47:19 +00:00

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

View File

@ -10,7 +10,7 @@ UberCount = 0
PUCount = 0 PUCount = 0
UnreleasedCount = 0 UnreleasedCount = 0
DeltaCount = 0 DeltaCount = 0
generation = ""
createTeamBookshelf = (format, requs, next) -> createTeamBookshelf = (format, requs, next) ->
createTeam format, requs, (mons, teamname) -> createTeam format, requs, (mons, teamname) ->
@ -201,6 +201,11 @@ generateMoves = (possibleMoves) ->
if movesArr.length < 4 if movesArr.length < 4
moveIndex = Math.floor(Math.random() * (possibleMoves.length)) moveIndex = Math.floor(Math.random() * (possibleMoves.length))
movename = possibleMoves[moveIndex] 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 #We reject the move if it's not defined
if typeof movename == "undefined" if typeof movename == "undefined"
generateMove() generateMove()