From ced0678d5ff7d9f0bc509d0a5ed1724c173ada3a Mon Sep 17 00:00:00 2001 From: PreciousTrainer Date: Sat, 16 Sep 2017 18:35:52 +0600 Subject: [PATCH] Fixing the Start Problem Someone has some problem during start so I have fixed them by editing the quest just sharing this. --- Libs/teamlib.lua | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/Libs/teamlib.lua b/Libs/teamlib.lua index 5c1d7fc..2768306 100644 --- a/Libs/teamlib.lua +++ b/Libs/teamlib.lua @@ -38,7 +38,9 @@ end --- @return : team index, of lowest leveled pkm under level_cap | nil, if none exists --- @type : integer | nil function team.getLowestPkmToLvl(level_cap) - return team._compare(team.getPkmToLvl(level_cap), gen.minLvl) + if getTeamSize() > 1 then + return team._compare(team.getPkmToLvl(level_cap), gen.minLvl) + end end function team.getAlivePkmToLvl(level_cap) @@ -113,7 +115,9 @@ function team.getLowestPkmAlive() end function team.getLowestLvl() - return getPokemonLevel(team.getLowestLvlPkm()) + if getTeamSize() > 1 then + return getPokemonLevel(team.getLowestLvlPkm()) + end end function team.getPkm() @@ -205,6 +209,7 @@ end --actual calculations function team._compare(t, fn) + if getTeamSize() > 1 then if not t then return nil end if #t == 0 then return nil end --, nil end local key, value = 1, t[1] @@ -214,6 +219,7 @@ function team._compare(t, fn) end end return value + end end function team._filter(t, fn, ...) @@ -264,4 +270,4 @@ function team._transform(t, fn) end -return team \ No newline at end of file +return team