mirror of
https://github.com/dcs-retribution/dcs-retribution.git
synced 2025-11-10 15:41:24 +00:00
Avoid duplicate groups id.
This commit is contained in:
parent
a76962e206
commit
9d4d3d0523
@ -77,7 +77,7 @@ def generate_groundobjects(theater: ConflictTheater, game):
|
||||
|
||||
if cp.cptype == ControlPointType.AIRCRAFT_CARRIER_GROUP:
|
||||
# Create ground object group
|
||||
group_id = group_id + 1
|
||||
group_id = game.next_group_id()
|
||||
g = TheaterGroundObject("CARRIER")
|
||||
g.group_id = group_id
|
||||
g.object_id = 0
|
||||
@ -100,7 +100,7 @@ def generate_groundobjects(theater: ConflictTheater, game):
|
||||
cp_to_remove.append(cp)
|
||||
elif cp.cptype == ControlPointType.LHA_GROUP:
|
||||
# Create ground object group
|
||||
group_id = group_id + 1
|
||||
group_id = game.next_group_id()
|
||||
g = TheaterGroundObject("LHA")
|
||||
g.group_id = group_id
|
||||
g.object_id = 0
|
||||
@ -133,7 +133,7 @@ def generate_groundobjects(theater: ConflictTheater, game):
|
||||
logging.info("Couldn't find point for {} base defense".format(cp))
|
||||
continue
|
||||
|
||||
group_id = group_id + 1
|
||||
group_id = game.next_group_id()
|
||||
|
||||
g = TheaterGroundObject("aa")
|
||||
g.group_id = group_id
|
||||
@ -175,7 +175,7 @@ def generate_groundobjects(theater: ConflictTheater, game):
|
||||
logging.info("Couldn't find point for {} ships".format(cp))
|
||||
continue
|
||||
|
||||
group_id = group_id + 1
|
||||
group_id = game.next_group_id()
|
||||
|
||||
g = TheaterGroundObject("aa")
|
||||
g.group_id = group_id
|
||||
@ -210,7 +210,7 @@ def generate_groundobjects(theater: ConflictTheater, game):
|
||||
logging.info("Couldn't find point for {} missiles".format(cp))
|
||||
continue
|
||||
|
||||
group_id = group_id + 1
|
||||
group_id = game.next_group_id()
|
||||
|
||||
g = TheaterGroundObject("aa")
|
||||
g.group_id = group_id
|
||||
@ -359,7 +359,7 @@ def generate_cp_ground_points(cp: ControlPoint, theater, game, group_id, templat
|
||||
continue
|
||||
|
||||
object_id = 0
|
||||
group_id = group_id + 1
|
||||
group_id = game.next_group_id()
|
||||
|
||||
logging.info("generated {} for {}".format(tpl_category, cp))
|
||||
|
||||
|
||||
@ -1,4 +1,5 @@
|
||||
from dcs.mapping import Point
|
||||
import uuid
|
||||
|
||||
NAME_BY_CATEGORY = {
|
||||
"power": "Power plant",
|
||||
@ -70,6 +71,7 @@ class TheaterGroundObject:
|
||||
groups = []
|
||||
obj_name = ""
|
||||
sea_object = False
|
||||
uuid = uuid.uuid1()
|
||||
|
||||
def __init__(self, category: str):
|
||||
self.category = category
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user