Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions dcs/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,5 +20,6 @@
from . import forcedoptions
from . import installation
from . import nav_target_point
from . import weapon_settings
from .mapping import Point, Rectangle, Polygon
from .mission import Mission
11 changes: 10 additions & 1 deletion dcs/flyingunit.py
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,16 @@ def load_pylon(self, weapon, pylon=None):
return False
if weapon is None:
return self.pylons.pop(pylon, None)
self.pylons[pylon] = {"CLSID": weapon[1]["clsid"]}
# Store the entire weapon dict to preserve settings and other properties
weapon_data = weapon[1]
if isinstance(weapon_data, dict):
self.pylons[pylon] = {"CLSID": weapon_data["clsid"]}
# Preserve additional properties like settings
if "settings" in weapon_data:
self.pylons[pylon]["settings"] = weapon_data["settings"]
else:
# Fallback for legacy code that might pass non-dict weapon data
self.pylons[pylon] = {"CLSID": weapon_data.get("clsid", weapon_data)}
return True

def store_loadout(self, filename):
Expand Down
46 changes: 28 additions & 18 deletions dcs/planes.py
Original file line number Diff line number Diff line change
Expand Up @@ -10874,6 +10874,7 @@ class C_130J_30(PlaneType):
"ramp_down": False,
"save_custom_data": True,
"allow_air_load": False,
"allow_moab": True,
"cargo_1": None,
"cargo_2": None,
"cargo_3": None,
Expand Down Expand Up @@ -10909,6 +10910,9 @@ class save_custom_data:
class allow_air_load:
id = "allow_air_load"

class allow_moab:
id = "allow_moab"

class cargo_1:
id = "cargo_1"

Expand Down Expand Up @@ -10977,6 +10981,12 @@ class cargo_10:
label="Allow Cargo Loading In Flight",
default=False,
),
"allow_moab": UnitPropertyDescription(
identifier="allow_moab",
control="checkbox",
label="Allow MOAB Cargo",
default=True,
),
"cargo_1": UnitPropertyDescription(
identifier="cargo_1",
control="editbox",
Expand Down Expand Up @@ -11402,7 +11412,7 @@ class Pylon2:
DIS_MK_20_DUAL_GDJ_II19_L = (2, Weapons.DIS_MK_20_DUAL_GDJ_II19_L)
DIS_GBU_12_DUAL_GDJ_II19_L = (2, Weapons.DIS_GBU_12_DUAL_GDJ_II19_L)
DIS_BRM1_90 = (2, Weapons.DIS_BRM1_90)
DIS_RKT_90_UG = (2, Weapons.DIS_RKT_90_UG)
DIS_HF20_90_1_HE = (2, Weapons.DIS_HF20_90_1_HE)
DIS_LAU68_MK5_DUAL_GDJ_II19_L = (2, Weapons.DIS_LAU68_MK5_DUAL_GDJ_II19_L)
DIS_WMD7 = (2, Weapons.DIS_WMD7)
DIS_AKG_DLPOD = (2, Weapons.DIS_AKG_DLPOD)
Expand Down Expand Up @@ -11498,7 +11508,7 @@ class Pylon6:
DIS_MK_20_DUAL_GDJ_II19_R = (6, Weapons.DIS_MK_20_DUAL_GDJ_II19_R)
DIS_GBU_12_DUAL_GDJ_II19_R = (6, Weapons.DIS_GBU_12_DUAL_GDJ_II19_R)
DIS_BRM1_90 = (6, Weapons.DIS_BRM1_90)
DIS_RKT_90_UG = (6, Weapons.DIS_RKT_90_UG)
DIS_HF20_90_1_HE = (6, Weapons.DIS_HF20_90_1_HE)
DIS_LAU68_MK5_DUAL_GDJ_II19_R = (6, Weapons.DIS_LAU68_MK5_DUAL_GDJ_II19_R)
DIS_WMD7 = (6, Weapons.DIS_WMD7)
DIS_AKG_DLPOD = (6, Weapons.DIS_AKG_DLPOD)
Expand Down Expand Up @@ -16813,9 +16823,9 @@ class F4U_1D_CW(PlaneType):
"F4U_GunsConvergence_Mid": 2,
"F4U_GunsConvergence_Outer": 2,
"F4U_CW_number": True,
"F4U_CW_number_1": 5,
"F4U_CW_number_2": 5,
"F4U_CW_number_3": 7,
"F4U_CW_number_1": 8,
"F4U_CW_number_2": 7,
"F4U_CW_number_3": 4,
}

class Properties:
Expand Down Expand Up @@ -16963,7 +16973,7 @@ class Values:
identifier="F4U_CW_number_1",
control="comboList",
label="1st number",
default=5,
default=8,
values={
0: "0",
1: "1",
Expand All @@ -16981,7 +16991,7 @@ class Values:
identifier="F4U_CW_number_2",
control="comboList",
label="2nd number",
default=5,
default=7,
values={
0: "0",
1: "1",
Expand All @@ -16999,7 +17009,7 @@ class Values:
identifier="F4U_CW_number_3",
control="comboList",
label="3rd number",
default=7,
default=4,
values={
0: "0",
1: "1",
Expand Down Expand Up @@ -18093,25 +18103,25 @@ class Hawk(PlaneType):
livery_name = "HAWK" # from type

class Pylon1:
LAU_7_with_AIM_9M_Sidewinder_IR_AAM_ = (1, Weapons.LAU_7_with_AIM_9M_Sidewinder_IR_AAM_)
LAU_61___19_x_UnGd_Rkts__70_mm_Hydra_70_M151_HE_ = (1, Weapons.LAU_61___19_x_UnGd_Rkts__70_mm_Hydra_70_M151_HE_)
CBU_87___202_x_CEM_Cluster_Bomb = (1, Weapons.CBU_87___202_x_CEM_Cluster_Bomb)
BRU_42_3_BDU_33 = (1, Weapons.BRU_42_3_BDU_33)
BRU_42_with_3_x_Mk_82___500lb_GP_Bombs_LD = (1, Weapons.BRU_42_with_3_x_Mk_82___500lb_GP_Bombs_LD)

class Pylon2:
Matra_Type_155_Rocket_Pod = (2, Weapons.Matra_Type_155_Rocket_Pod)
CBU_87___202_x_CEM_Cluster_Bomb = (2, Weapons.CBU_87___202_x_CEM_Cluster_Bomb)
BRU_42_3_BDU_33 = (2, Weapons.BRU_42_3_BDU_33)
Mk_82___500lb_GP_Bomb_LD = (2, Weapons.Mk_82___500lb_GP_Bomb_LD)
LAU_7_with_AIM_9M_Sidewinder_IR_AAM_ = (2, Weapons.LAU_7_with_AIM_9M_Sidewinder_IR_AAM_)

class Pylon3:
ADEN_GUNPOD = (3, Weapons.ADEN_GUNPOD)

class Pylon4:
Matra_Type_155_Rocket_Pod = (4, Weapons.Matra_Type_155_Rocket_Pod)
CBU_87___202_x_CEM_Cluster_Bomb = (4, Weapons.CBU_87___202_x_CEM_Cluster_Bomb)
BRU_42_3_BDU_33 = (4, Weapons.BRU_42_3_BDU_33)
Mk_82___500lb_GP_Bomb_LD = (4, Weapons.Mk_82___500lb_GP_Bomb_LD)
LAU_7_with_AIM_9M_Sidewinder_IR_AAM_ = (4, Weapons.LAU_7_with_AIM_9M_Sidewinder_IR_AAM_)

class Pylon5:
LAU_7_with_AIM_9M_Sidewinder_IR_AAM_ = (5, Weapons.LAU_7_with_AIM_9M_Sidewinder_IR_AAM_)
LAU_61___19_x_UnGd_Rkts__70_mm_Hydra_70_M151_HE_ = (5, Weapons.LAU_61___19_x_UnGd_Rkts__70_mm_Hydra_70_M151_HE_)
CBU_87___202_x_CEM_Cluster_Bomb = (5, Weapons.CBU_87___202_x_CEM_Cluster_Bomb)
BRU_42_3_BDU_33 = (5, Weapons.BRU_42_3_BDU_33)
BRU_42_with_3_x_Mk_82___500lb_GP_Bombs_LD = (5, Weapons.BRU_42_with_3_x_Mk_82___500lb_GP_Bombs_LD)

class Pylon6:
Smoke_Generator___red = (6, Weapons.Smoke_Generator___red)
Expand Down
2 changes: 1 addition & 1 deletion dcs/unittype.py
Original file line number Diff line number Diff line change
Expand Up @@ -193,7 +193,7 @@ def loadout_by_name(cls, loadout_name):
if payload is None:
return None
pylons = payload["pylons"]
r = [(pylons[x]["num"], {"clsid": pylons[x]["CLSID"]}) for x in pylons]
r = [(pylons[x]["num"], {"clsid": pylons[x]["CLSID"], "settings": pylons[x].get("settings", {})}) for x in pylons]
return r
return None

Expand Down
4 changes: 2 additions & 2 deletions dcs/vehicles.py
Original file line number Diff line number Diff line change
Expand Up @@ -985,8 +985,8 @@ class bofors40(unittype.VehicleType):
id = "bofors40"
name = "AAA Bofors 40mm"
detection_range = 0
threat_range = 4000
air_weapon_dist = 4000
threat_range = 2000
air_weapon_dist = 2000

class flak18(unittype.VehicleType):
id = "flak18"
Expand Down
Loading