@@ -1242,7 +1242,6 @@ function BotManager:_CheckForBotBotRevive()
1242
1242
local s_MedicBots = {}
1243
1243
local s_BotsAlreadInRevive = {}
1244
1244
1245
- local s_RaycastEntries = {}
1246
1245
for _ , l_Bot in ipairs (self ._Bots ) do
1247
1246
if not l_Bot .m_InVehicle then
1248
1247
if l_Bot .m_Player .corpse and not l_Bot .m_Player .corpse .isDead then
@@ -1290,9 +1289,9 @@ function BotManager:_CheckForBotBotRevive()
1290
1289
1291
1290
if # s_MedicBots > 0 and # s_BotsToRevive > 0 then
1292
1291
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
1296
1295
local s_PosBody = l_DeadBot .m_Player .corpse .physicsEntityBase .position :Clone ()
1297
1296
local s_PosMedic = l_MedicBot .m_Player .soldier .worldTransform .trans :Clone ()
1298
1297
local s_Distance = s_PosBody :Distance (s_PosMedic )
@@ -1306,6 +1305,7 @@ function BotManager:_CheckForBotBotRevive()
1306
1305
if # s_Result == 0 then
1307
1306
-- free sight
1308
1307
l_MedicBot :Revive (l_DeadBot .m_Player )
1308
+ s_MedicBots [l_Index ] = nil -- delete entry to not go over it again
1309
1309
end
1310
1310
if s_NrOfRaycastsDone >= Registry .GAME_RAYCASTING .BOT_BOT_REVIVE_MAX_RAYCASTS then
1311
1311
goto endOfCheck
0 commit comments