diff --git a/Moose Development/Moose/Core/MarkerOps_Base.lua b/Moose Development/Moose/Core/MarkerOps_Base.lua index a8265a52e..222866321 100644 --- a/Moose Development/Moose/Core/MarkerOps_Base.lua +++ b/Moose Development/Moose/Core/MarkerOps_Base.lua @@ -154,14 +154,7 @@ function MARKEROPS_BASE:OnEventMark(Event) self:E("Skipping onEvent. Event or Event.idx unknown.") return true end - --position - if self.debug then - local vec3={y=Event.pos.y, x=Event.pos.x, z=Event.pos.z} - local coord=COORDINATE:NewFromVec3(vec3) - local coordtext = coord:ToStringLLDDM() - local text = tostring(Event.text) - local m = MESSAGE:New(string.format("Mark added at %s with text: %s",coordtext,text),10,"Info",false):ToAll() - end + local coalition = Event.MarkCoalition -- decision if Event.id==world.event.S_EVENT_MARK_ADDED then @@ -170,15 +163,14 @@ function MARKEROPS_BASE:OnEventMark(Event) local Eventtext = tostring(Event.text) if Eventtext~=nil then if self:_MatchTag(Eventtext) then - local coord=COORDINATE:NewFromVec3({y=Event.pos.y, x=Event.pos.x, z=Event.pos.z}) - if self.debug then - local coordtext = coord:ToStringLLDDM() - local text = tostring(Event.text) - local m = MESSAGE:New(string.format("Mark added at %s with text: %s",coordtext,text),10,"Info",false):ToAll() - end - local matchtable = self:_MatchKeywords(Eventtext) - local coord=COORDINATE:NewFromVec3(vec3) - self:MarkAdded(Eventtext,matchtable,coord,Event.idx,coalition,Event.PlayerName,Event) + local coord=COORDINATE:NewFromVec3({y=Event.pos.y, x=Event.pos.x, z=Event.pos.z}) + if self.debug then + local coordtext = coord:ToStringLLDDM() + local text = tostring(Event.text) + local m = MESSAGE:New(string.format("Mark added at %s with text: %s",coordtext,text),10,"Info",false):ToAll() + end + local matchtable = self:_MatchKeywords(Eventtext) + self:MarkAdded(Eventtext,matchtable,coord,Event.idx,coalition,Event.PlayerName,Event) end end elseif Event.id==world.event.S_EVENT_MARK_CHANGE then @@ -187,15 +179,14 @@ function MARKEROPS_BASE:OnEventMark(Event) local Eventtext = tostring(Event.text) if Eventtext~=nil then if self:_MatchTag(Eventtext) then - local coord=COORDINATE:NewFromVec3({y=Event.pos.y, x=Event.pos.x, z=Event.pos.z}) - if self.debug then + local coord=COORDINATE:NewFromVec3({y=Event.pos.y, x=Event.pos.x, z=Event.pos.z}) + if self.debug then local coordtext = coord:ToStringLLDDM() local text = tostring(Event.text) - local m = MESSAGE:New(string.format("Mark added at %s with text: %s",coordtext,text),10,"Info",false):ToAll() - end - local matchtable = self:_MatchKeywords(Eventtext) - local coord=COORDINATE:NewFromVec3(vec3) - self:MarkChanged(Eventtext,matchtable,coord,Event.idx,coalition,Event.PlayerName,Event) + local m = MESSAGE:New(string.format("Mark changed at %s with text: %s",coordtext,text),10,"Info",false):ToAll() + end + local matchtable = self:_MatchKeywords(Eventtext) + self:MarkChanged(Eventtext,matchtable,coord,Event.idx,coalition,Event.PlayerName,Event) end end elseif Event.id==world.event.S_EVENT_MARK_REMOVED then