DEADSOFTWARE

New implementation of module Items, *.cfg files now deprecated
[cavecraft.git] / src / items_logic.mpsrc
index a3d41c04f757880049a1db63f27694ee9ad375bb..84db3342d06b6dc5d9bee8e6a00abe704949010b 100644 (file)
@@ -12,7 +12,8 @@ interface
  procedure updateBlock(x, y:integer);\r
 \r
 implementation\r
- uses invui, maps, drop, console, furnace, png3, func, jpeg, mobs, vars, bmp, items, chest, inv, player, items_store, particles, worldgen, phy, sign;\r
+\r
+  uses invui, maps, drop, console, furnace, png3, func, jpeg, mobs, vars, bmp, chest, inv, player, items_store, particles, worldgen, phy, sign, Blocks;\r
 \r
 procedure usebonemeal(block:integer);\r
  var\r
@@ -1153,7 +1154,7 @@ procedure fluidLogic(x, y, ifbx, thenbx, ifby, thenby:integer);
    setMap(thenby, x, y+1);\r
   else\r
   //Если нижний блок можно уничтожить, то ставим туда копию\r
-  if getBlockSet(blockYp1) then\r
+  if Blocks.IsOverlapped(blockYp1) then\r
    begin\r
     destroy_block_0(blockYp1, x, y+1);\r
     setMap(block, x, y+1);\r
@@ -1164,7 +1165,7 @@ procedure fluidLogic(x, y, ifbx, thenbx, ifby, thenby:integer);
     if blockXm1=ifbx then\r
      setMap(thenbx, x-1, y);\r
     else\r
-    if getBlockSet(blockXm1) then\r
+    if Blocks.IsOverlapped(blockXm1) then\r
      begin\r
       destroy_block_1(blockXm1, x-1, y);\r
       setMap(block, x-1, y);\r
@@ -1173,7 +1174,7 @@ procedure fluidLogic(x, y, ifbx, thenbx, ifby, thenby:integer);
     if blockXp1=ifbx then\r
      setMap(thenbx, x+1, y);\r
     else\r
-    if getBlockSet(blockXp1) then\r
+    if Blocks.IsOverlapped(blockXp1) then\r
      begin\r
       destroy_block_1(blockXp1, x+1, y);\r
       setMap(block, x+1, y);\r
@@ -1202,7 +1203,7 @@ procedure updateBlock(x, y:integer);
   if block=2 then\r
    begin\r
     //Трава разрастается при условии что освещение выше чем 3\r
-    if (getBlockSet(getMap(x, y-1))=false) or (light=0) then\r
+    if (light = 0) or (Blocks.IsOverlapped(getMap(x, y - 1)) = false) then\r
      setMap(1, x, y);\r
     else\r
     if light>3 then\r
@@ -1219,7 +1220,7 @@ procedure updateBlock(x, y:integer);
   else\r
   if block=7 then\r
    begin\r
-    if getBlockSet(getMap(x, y+1)) then\r
+    if Blocks.IsOverlapped(getMap(x, y+1)) then\r
      begin\r
       setMap(0, x, y);\r
       setMap(7, x, y+1);\r
@@ -1228,7 +1229,7 @@ procedure updateBlock(x, y:integer);
   else\r
   if block=8 then\r
    begin\r
-    if getBlockSet(getMap(x, y+1)) then\r
+    if Blocks.IsOverlapped(getMap(x, y+1)) then\r
      begin\r
       setMap(0, x, y);\r
       setMap(8, x, y+1);\r
@@ -1260,7 +1261,7 @@ procedure updateBlock(x, y:integer);
   else\r
   if block=74 then\r
    begin\r
-    if getBlockSet(getMap(x, y-1))=false then\r
+    if Blocks.IsOverlapped(getMap(x, y-1))=false then\r
      setMap(1, x, y);\r
     else\r
     if light>3 then\r