Skip to content

Commit

Permalink
6.01.00111: tixed placeable Bunkersilo issue
Browse files Browse the repository at this point in the history
fixes # 3297
  • Loading branch information
ThomasGaertner committed Mar 3, 2019
1 parent 3aa8c70 commit 410592e
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 6 deletions.
2 changes: 1 addition & 1 deletion modDesc.xml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8" standalone="no" ?>
<modDesc descVersion="40">
<version>6.01.00110</version>
<version>6.01.00111</version>
<author><![CDATA[Courseplay.devTeam]]></author>
<title>
<br>CoursePlay SIX</br>
Expand Down
9 changes: 4 additions & 5 deletions triggers.lua
Original file line number Diff line number Diff line change
Expand Up @@ -487,16 +487,15 @@ function courseplay:updateAllTriggers()
for _, trigger in pairs(g_currentMission.bunkerSilos) do
if courseplay:isValidTipTrigger(trigger) and trigger.bunkerSilo then
local triggerId = trigger.triggerId;
local name = tostring(getName(triggerId));
local className = tostring(trigger.className);
local detailId = g_currentMission.terrainDetailId
courseplay:debug((' add tipTrigger: id=%d, is BunkerSiloTipTrigger '):format(triggerId), 1);

--local area = trigger.bunkerSiloArea
--local px,pz, pWidthX,pWidthZ, pHeightX,pHeightZ = Utils.getXZWidthAndHeight(detailId, area.sx,area.sz, area.wx, area.wz, area.hx, area.hz);
--local _ ,_,totalArea = getDensityParallelogram(detailId, px, pz, pWidthX, pWidthZ, pHeightX, pHeightZ, g_currentMission.terrainDetailTypeFirstChannel, g_currentMission.terrainDetailTypeNumChannels);
trigger.capacity = 10000000 --DensityMapHeightUtil.volumePerPixel*totalArea*800 ;
--print(string.format("capacity= %s fillLevel= %s ",tostring(trigger.capacity),tostring(trigger.fillLevel)))
courseplay:cpAddTrigger(triggerId, trigger, 'tipTrigger');
courseplay:debug((' add tipTrigger: id=%d, name=%q, className=%q, is BunkerSiloTipTrigger '):format(triggerId, name, className), 1);

end
end
end
Expand Down Expand Up @@ -538,7 +537,7 @@ end;

--Tommi TODO check if its still needed
function courseplay:isValidTipTrigger(trigger)
local isValid = trigger.className and (trigger.className == 'SiloTrigger' or trigger.isAlternativeTipTrigger or StringUtil.endsWith(trigger.className, 'TipTrigger'));
local isValid = trigger.className and (trigger.className == 'SiloTrigger' or trigger.isAlternativeTipTrigger or StringUtil.endsWith(trigger.className, 'TipTrigger') and trigger.triggerId ~= nil);
return isValid;
end;

Expand Down

0 comments on commit 410592e

Please sign in to comment.