From 575143fec90251c44dd17a64ffe19eff4023ddb9 Mon Sep 17 00:00:00 2001 From: Ciaran Fisher Date: Sun, 24 Apr 2016 21:54:41 +0100 Subject: [PATCH] Bug Fix for Pilot Lives reset --- CSAR.lua | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/CSAR.lua b/CSAR.lua index 82ab19f..a3fb7f3 100644 --- a/CSAR.lua +++ b/CSAR.lua @@ -192,6 +192,12 @@ csar.allowFARPRescue = true --allows pilot to be rescued by landing at a FARP or -- csar.resetAllPilotLives() -- function csar.resetAllPilotLives() + + for x, _pilot in pairs(csar.pilotLives) do + + trigger.action.setUserFlag("CSAR_PILOT".._pilot:gsub('%W',''),csar.maxLives+1) + end + csar.pilotLives = {} env.info("Pilot Lives Reset!") end @@ -201,7 +207,11 @@ end -- csar.resetAllPilotLives() -- function csar.resetPilotLife(_playerName) + csar.pilotLives[_playerName] = nil + + trigger.action.setUserFlag("CSAR_PILOT".._playerName:gsub('%W',''),csar.maxLives+1) + env.info("Pilot life Reset!") end