diff --git a/Assets/ManagedResources/~Lua/Modules/Player/PlayerManager.lua b/Assets/ManagedResources/~Lua/Modules/Player/PlayerManager.lua index 776df7d755..da28cb4575 100644 --- a/Assets/ManagedResources/~Lua/Modules/Player/PlayerManager.lua +++ b/Assets/ManagedResources/~Lua/Modules/Player/PlayerManager.lua @@ -555,9 +555,9 @@ function this.GetMainPlayerNPCData3(fun) end end function this.RandomRankNPC(currankAllList) - local playerRandomNum = math.random(1, 25) + local playerRandomNum = math.random(1, #currankAllList) if rankNPCList[playerRandomNum] then - this.RandomRankNPC() + this.RandomRankNPC(currankAllList) else rankNPCList[playerRandomNum] = currankAllList[playerRandomNum] -- LogGreen("rank "..currankAllList[playerRandomNum].userName) @@ -567,7 +567,7 @@ end function this.RandomFirendNPC(currankAllList) local playerRandomNum = math.random(1, #currankAllList) if friendNPCList[playerRandomNum] then - this.RandomFirendNPC() + this.RandomFirendNPC(currankAllList) else friendNPCList[playerRandomNum] = currankAllList[playerRandomNum] -- LogGreen("friend "..currankAllList[playerRandomNum].userName)