mirror of
https://github.com/dcs-retribution/dcs-retribution.git
synced 2025-11-10 15:41:24 +00:00
Always initialize IADS coalition lua tables.
These are read unconditionally, but were only initialized when the coalition had nodes. When a coalition had no nodes, this caused a nil access. It's unclear if that had any symptoms, but I expect at the very least it would break the remainder of the script (so a non-functioning blue IADS if the red IADS had no nodes). There's a very small chance this is the culprit behind https://github.com/dcs-liberation/dcs_liberation/issues/3073.
This commit is contained in:
@@ -194,6 +194,11 @@ class LuaGenerator:
|
||||
|
||||
# Generate IADS Lua Item
|
||||
iads_object = lua_data.add_item("IADS")
|
||||
# These should always be created even if they are empty.
|
||||
iads_object.get_or_create_item("BLUE")
|
||||
iads_object.get_or_create_item("RED")
|
||||
# Should probably do the same with all the roles... but the script is already
|
||||
# tolerant of those being empty.
|
||||
for node in self.game.theater.iads_network.skynet_nodes(self.game):
|
||||
coalition = iads_object.get_or_create_item("BLUE" if node.player else "RED")
|
||||
iads_type = coalition.get_or_create_item(node.iads_role.value)
|
||||
|
||||
Reference in New Issue
Block a user