DEADSOFTWARE

correctly freeing dynrecords; as a consequence, no more memory leaks in custom game...
[d2df-sdl.git] / src / game / g_triggers.pas
index 1b52a64a1d25d68d0776d4062df24daf61d04517..1c8a586126ee9f15517ffba8d288b0245aa7254b 100644 (file)
@@ -2128,7 +2128,7 @@ begin
   Trigger.mapIndex := mapidx;
   if (Trigger.trigData.trigRec <> nil) then
   begin
-    Trigger.trigData := Trigger.trigData.trigRec.clone();
+    Trigger.trigData := Trigger.trigData.trigRec.clone({Trigger.trigData.headerRec}nil);
   end
   else
   begin
@@ -2465,9 +2465,17 @@ begin
             end;
           end;
 
+          //HACK!
           // if we have panelid, assume that it will switch the moving platform
-          if (trigPanelGUID >= 0) then
+          pan := g_Map_PanelByGUID(trigPanelGUID);
+          if (pan <> nil) then
           begin
+            case TriggerType of
+              TRIGGER_PRESS: pan.movingActive := true; // what to do here?
+              TRIGGER_ON: pan.movingActive := true;
+              TRIGGER_OFF: pan.movingActive := false;
+              TRIGGER_ONOFF: pan.movingActive := not pan.movingActive;
+            end;
           end;
 
           // Âûáèðàåì îäèí èç òðèããåðîâ äëÿ ðàñøèðèòåëÿ, åñëè âêëþ÷åí ðàíäîì: