mirror of
https://github.com/FlightControl-Master/MOOSE.git
synced 2026-08-23 11:40:57 +00:00
Add check for IniGroup in HandleEventShot
Added a check for IniGroup in HandleEventShot to prevent processing if it's not present. Error in 2 instances, attempt to index field IniGroup ( a nil value )
This commit is contained in:
@@ -684,6 +684,7 @@ do
|
|||||||
local ShootingWeapon = EventData.Weapon -- Identify the weapon fired
|
local ShootingWeapon = EventData.Weapon -- Identify the weapon fired
|
||||||
local ShootingWeaponName = EventData.WeaponName -- return weapon type
|
local ShootingWeaponName = EventData.WeaponName -- return weapon type
|
||||||
-- get firing coalition
|
-- get firing coalition
|
||||||
|
if not EventData.IniGroup then return self end
|
||||||
local weaponcoalition = EventData.IniGroup:GetCoalition()
|
local weaponcoalition = EventData.IniGroup:GetCoalition()
|
||||||
-- get detection probability
|
-- get detection probability
|
||||||
if self:_CheckCoalition(weaponcoalition) then --avoid overhead on friendly fire
|
if self:_CheckCoalition(weaponcoalition) then --avoid overhead on friendly fire
|
||||||
|
|||||||
Reference in New Issue
Block a user