@@ -1242,7 +1242,6 @@ function BotManager:_CheckForBotBotRevive()
12421242 local s_MedicBots = {}
12431243 local s_BotsAlreadInRevive = {}
12441244
1245- local s_RaycastEntries = {}
12461245 for _ , l_Bot in ipairs (self ._Bots ) do
12471246 if not l_Bot .m_InVehicle then
12481247 if l_Bot .m_Player .corpse and not l_Bot .m_Player .corpse .isDead then
@@ -1290,9 +1289,9 @@ function BotManager:_CheckForBotBotRevive()
12901289
12911290 if # s_MedicBots > 0 and # s_BotsToRevive > 0 then
12921291 for _ , l_DeadBot in ipairs (s_BotsToRevive ) do
1293- local s_DeadBotTeam = l_DeadBot .m_Player .teamid
1294- for _ , l_MedicBot in ipairs (s_MedicBots ) do
1295- if l_MedicBot .m_Player .teamid == s_DeadBotTeam then
1292+ local s_DeadBotTeam = l_DeadBot .m_Player .teamId
1293+ for l_Index , l_MedicBot in pairs (s_MedicBots ) do
1294+ if l_MedicBot .m_Player .teamId == s_DeadBotTeam then
12961295 local s_PosBody = l_DeadBot .m_Player .corpse .physicsEntityBase .position :Clone ()
12971296 local s_PosMedic = l_MedicBot .m_Player .soldier .worldTransform .trans :Clone ()
12981297 local s_Distance = s_PosBody :Distance (s_PosMedic )
@@ -1306,6 +1305,7 @@ function BotManager:_CheckForBotBotRevive()
13061305 if # s_Result == 0 then
13071306 -- free sight
13081307 l_MedicBot :Revive (l_DeadBot .m_Player )
1308+ s_MedicBots [l_Index ] = nil -- delete entry to not go over it again
13091309 end
13101310 if s_NrOfRaycastsDone >= Registry .GAME_RAYCASTING .BOT_BOT_REVIVE_MAX_RAYCASTS then
13111311 goto endOfCheck
0 commit comments