diff --git a/Generator/requirements.txt b/Generator/requirements.txt index e495ca7..46e80cd 100644 --- a/Generator/requirements.txt +++ b/Generator/requirements.txt @@ -1,4 +1,4 @@ --e git+https://github.com/spencershepard/dcs@c98df748aa91edaf8db1b6fcfd869cd232647aff#egg=pydcs +-e git+https://github.com/spencershepard/dcs@48b32ae917b2a67d9409345a1f5c368e59e5229f#egg=pydcs packaging==21.3 PyQt5==5.15.9 PyYAML==6.0 diff --git a/Generator/version.py b/Generator/version.py index 562b18a..802efa4 100644 --- a/Generator/version.py +++ b/Generator/version.py @@ -1,7 +1,7 @@ # ROTOROPS VERSION maj_version = 1 minor_version = 8 -patch_version = 2 +patch_version = 3 version_url = 'https://dcs-helicopters.com/app-updates/versioncheck.yaml' diff --git a/config/blue_player_loadouts.miz b/config/blue_player_loadouts.miz index ad6f056..57dd181 100644 Binary files a/config/blue_player_loadouts.miz and b/config/blue_player_loadouts.miz differ diff --git a/scripts/RotorOps.lua b/scripts/RotorOps.lua index d096c01..98b5240 100644 --- a/scripts/RotorOps.lua +++ b/scripts/RotorOps.lua @@ -1,5 +1,5 @@ RotorOps = {} -RotorOps.version = "1.4.3" +RotorOps.version = "1.4.4" local debug = false @@ -32,7 +32,7 @@ RotorOps.farp_smoke_color = 2 -- Green=0 Red=1 White=2 Orange=3 Blue=4 NONE= -1 --RotorOps settings that are safe to change only before calling setupConflict() -RotorOps.transports = {'UH-1H', 'Mi-8MT', 'Mi-24P', 'SA342M', 'SA342L', 'SA342Mistral', 'UH-60L'} --players flying these will have ctld transport access +RotorOps.transports = {'UH-1H', 'Mi-8MT', 'Mi-24P', 'SA342M', 'SA342L', 'SA342Mistral', 'UH-60L', 'CH-47Fbl1'} --players flying these will have ctld transport access RotorOps.CTLD_crates = false RotorOps.CTLD_sound_effects = true --sound effects for troop pickup/dropoffs RotorOps.exclude_ai_group_name = "Static" --include this somewhere in a group name to exclude the group from being tasked in the active zone @@ -333,7 +333,7 @@ function RotorOps.eventHandler:onEvent(event) ---UNIT DESTROYED EVENTS if (world.event.S_EVENT_KILL == event.id) then if event.initiator and event.target then - if not Unit.getGroup(event.initiator) then + if not event.initiator.getCoalition or not event.target.getCoalition then return end if event.initiator:getCoalition() and event.target:getCoalition() and event.initiator:getCoalition() ~= event.target:getCoalition() then @@ -523,17 +523,18 @@ end function RotorOps.getValidUnitFromGroup(grp) + if grp == nil then return end local group_obj if type(grp) == 'string' then group_obj = Group.getByName(grp) else group_obj = grp end - if not group_obj then - return nil + if group_obj == nil then + return end - if group_obj:isExist() ~= true then - return nil + if group_obj.isExist == nil or group_obj:isExist() ~= true then + return end local first_valid_unit for index, unit in pairs(group_obj:getUnits()) @@ -703,8 +704,9 @@ function RotorOps.chargeEnemy(vars) --trigger.action.outText("charge enemies: "..mist.utils.tableShow(vars), 5) local grp = vars.grp local search_radius = vars.radius or 5000 - ---- + ---- local first_valid_unit = RotorOps.getValidUnitFromGroup(grp) + if first_valid_unit == nil then return end if first_valid_unit == nil then return end local start_point = first_valid_unit:getPoint() @@ -781,8 +783,8 @@ function RotorOps.patrolRadius(vars) --debugMsg("patrol radius: "..mist.utils.tableShow(vars.grp)) local grp = vars.grp local search_radius = vars.radius or 100 - local first_valid_unit - if grp:isExist() ~= true then return end + local first_valid_unit = RotorOps.getValidUnitFromGroup(grp) + if first_valid_unit == nil then return end for index, unit in pairs(grp:getUnits()) do if unit:isExist() == true then @@ -847,8 +849,8 @@ function RotorOps.shiftPosition(vars) local grp = vars.grp local search_radius = vars.radius or 100 local inner_radius = 50 --minimum distance to move for randpointincircle - local first_valid_unit - if grp and grp:isExist() ~= true then return end + local first_valid_unit = RotorOps.getValidUnitFromGroup(grp) + if first_valid_unit == nil then return end local start_point = vars.point if not start_point then @@ -897,8 +899,8 @@ function RotorOps.guardPosition(vars) --debugMsg("patrol radius: "..mist.utils.tableShow(vars.grp)) local grp = vars.grp local search_radius = vars.radius or 100 - local first_valid_unit - if not grp or grp:isExist() ~= true then return end + local first_valid_unit = RotorOps.getValidUnitFromGroup(grp) + if first_valid_unit == nil then return end local start_point = vars.point if not start_point then @@ -1611,6 +1613,7 @@ function RotorOps.setupCTLD() ["Mi-8MT"] = 24, ["Mi-24P"] = 8, ["UH-60L"] = 11, + ["CH-47Fbl1"] = 33 } ctld.loadableGroups = { diff --git a/scripts/RotorOpsPerks.lua b/scripts/RotorOpsPerks.lua index 1b41889..967c6ff 100644 --- a/scripts/RotorOpsPerks.lua +++ b/scripts/RotorOpsPerks.lua @@ -15,7 +15,7 @@ RotorOpsPerks = {} -RotorOpsPerks.version = "1.7.0" +RotorOpsPerks.version = "1.7.1" env.warning('ROTOROPS PERKS STARTED: '..RotorOpsPerks.version) trigger.action.outText('ROTOROPS PERKS STARTED: '..RotorOpsPerks.version, 10) RotorOpsPerks.perks = {} @@ -52,14 +52,14 @@ RotorOpsPerks.points = { RotorOpsPerks.player_fatcow_types = { "UH-60L", "Mi-8MT", - --insert CH-47 here! + "CH-47Fbl1" } RotorOpsPerks.static_helicopters_at_farp = true --spawn static helicopters at the FARP if player reslots RotorOpsPerks.static_helicopter_types = { --mapping of player helicopters to their static equivalents ["UH-60L"] = "UH-60A", ["Mi-8MT"] = "Mi-8MT", - --insert CH-47 here! + ["CH-47Fbl1"] = "CH-47D" } ---- END OPTIONS ---- @@ -1469,6 +1469,11 @@ function handle:onEvent(e) return end + if not e.initiator.getName then + log('LEAVE: cannot get initiator player name. Returning.') + return + end + local player_unit_name = e.initiator:getName() log('player_unit_name is ' .. player_unit_name) local player_name = e.initiator:getPlayerName()