DEADSOFTWARE

game: disable gibs for server
[d2df-sdl.git] / src / game / g_panel.pas
index 87bbb476ea2ed2be218abb30f6988877e58cba39..f9b7371f213c2f8b4b380e02ec61bd7b03b6672f 100644 (file)
@@ -216,9 +216,16 @@ var
 
 implementation
 
-uses
-  g_basic, g_map, g_game, g_gfx, g_weapons, g_triggers,
-  g_console, g_language, g_monsters, g_player, g_grid, e_log, geom, utils, xstreams;
+  uses
+    {$IFDEF ENABLE_GFX}
+      g_gfx,
+    {$ENDIF}
+    {$IFDEF ENABLE_GIBS}
+      g_gibs,
+    {$ENDIF}
+    g_basic, g_map, g_game, g_weapons, g_triggers,
+    g_console, g_language, g_monsters, g_player, g_grid, e_log, geom, utils, xstreams
+  ;
 
 const
   PANEL_SIGNATURE = $4C4E4150; // 'PANL'
@@ -436,7 +443,9 @@ begin
       e_LogWritefln('panel moved: arridx=%s; guid=%s; proxyid=%s; old:(%s,%s)-(%sx%s); new:(%s,%s)-(%sx%s)',
         [arrIdx, mGUID, proxyId, px, py, pw, ph, x, y, width, height]);
       }
-      g_Mark(px, py, pw, ph, MARK_WALL, false);
+      {$IFDEF ENABLE_GFX}
+        g_Mark(px, py, pw, ph, MARK_WALL, false);
+      {$ENDIF}
       if (Width < 1) or (Height < 1) then
       begin
         mapGrid.proxyEnabled[proxyId] := false;
@@ -453,7 +462,9 @@ begin
         begin
           mapGrid.moveBody(proxyId, X, Y);
         end;
-        g_Mark(X, Y, Width, Height, MARK_WALL);
+        {$IFDEF ENABLE_GFX}
+          g_Mark(X, Y, Width, Height, MARK_WALL);
+        {$ENDIF}
       end;
     end;
   end;
@@ -566,7 +577,9 @@ var
   px, py, pw, ph, pdx, pdy: Integer;
   squash: Boolean;
   plr: TPlayer;
-  gib: PGib;
+  {$IFDEF ENABLE_GIBS}
+    gib: PGib;
+  {$ENDIF}
   cor: TCorpse;
   mon: TMonster;
   mpfrid: LongWord;
@@ -675,19 +688,21 @@ begin
           if not g_Game_IsClient and squash then plr.Damage(15000, 0, 0, 0, HIT_TRAP);
         end;
 
-        // process gibs
-        for f := 0 to High(gGibs) do
-        begin
-          gib := @gGibs[f];
-          if not gib.alive then continue;
-          gib.getMapBox(px, py, pw, ph);
-          if not g_Collide(px, py, pw, ph, cx0, cy0, cw, ch) then continue;
-          if tryMPlatMove(px, py, pw, ph, pdx, pdy, squash, @ontop) then
+        {$IFDEF ENABLE_GIBS}
+          // process gibs
+          for f := 0 to High(gGibs) do
           begin
-            // set new position
-            gib.moveBy(pdx, pdy); // this will call `positionChanged()` for us
+            gib := @gGibs[f];
+            if not gib.alive then continue;
+            gib.getMapBox(px, py, pw, ph);
+            if not g_Collide(px, py, pw, ph, cx0, cy0, cw, ch) then continue;
+            if tryMPlatMove(px, py, pw, ph, pdx, pdy, squash, @ontop) then
+            begin
+              // set new position
+              gib.moveBy(pdx, pdy); // this will call `positionChanged()` for us
+            end;
           end;
-        end;
+        {$ENDIF}
 
         // move and push corpses
         for f := 0 to High(gCorpses) do