diff --git a/lua/DCS-gRPC/exporters/object.lua b/lua/DCS-gRPC/exporters/object.lua index cc791e45..ebc3ad34 100644 --- a/lua/DCS-gRPC/exporters/object.lua +++ b/lua/DCS-gRPC/exporters/object.lua @@ -45,6 +45,7 @@ GRPC.exporters.rawTransform = function(object) end GRPC.exporters.group = function(group) + if type(group) ~= "table" and getmetatable(group) ~= Group then return nil end return { id = tonumber(group:getID()), name = group:getName(), diff --git a/protos/dcs/common/v0/common.proto b/protos/dcs/common/v0/common.proto index c9e13f79..5c33bbdf 100644 --- a/protos/dcs/common/v0/common.proto +++ b/protos/dcs/common/v0/common.proto @@ -231,8 +231,8 @@ message Unit { Velocity velocity = 8; // The name of the player if one is in control of the unit optional string player_name = 9; - // The group that the unit belongs to - Group group = 10; + // The group that the unit belongs to (dead units have no group) + optional Group group = 10; // The number of this unit in the group. Does not change as units are // destroyed uint32 number_in_group = 11;