mirror of
https://github.com/ClassiCube/MCGalaxy.git
synced 2025-09-23 04:32:50 -04:00
Core: fix odoors
This commit is contained in:
parent
2480349443
commit
bce5a35948
@ -22,7 +22,7 @@ namespace MCGalaxy.BlockPhysics {
|
|||||||
public static class DoorPhysics {
|
public static class DoorPhysics {
|
||||||
|
|
||||||
public static void odoorPhysics(Level lvl, ref Check C) {
|
public static void odoorPhysics(Level lvl, ref Check C) {
|
||||||
if (C.data.Data != 0) { C.data.Data = 0; return; }
|
if (C.data.Data != 0) { C.data.Data = 255; return; }
|
||||||
|
|
||||||
odoorNeighbour(lvl, ref C, lvl.IntOffset(C.b, -1, 0, 0));
|
odoorNeighbour(lvl, ref C, lvl.IntOffset(C.b, -1, 0, 0));
|
||||||
odoorNeighbour(lvl, ref C, lvl.IntOffset(C.b, +1, 0, 0));
|
odoorNeighbour(lvl, ref C, lvl.IntOffset(C.b, +1, 0, 0));
|
||||||
@ -33,12 +33,11 @@ namespace MCGalaxy.BlockPhysics {
|
|||||||
C.data.Data++;
|
C.data.Data++;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void odoorNeighbour(Level lvl, ref Check C, int offset) {
|
static void odoorNeighbour(Level lvl, ref Check C, int index) {
|
||||||
int index = C.b + offset;
|
|
||||||
byte block = Block.odoor(lvl.GetTile(index));
|
byte block = Block.odoor(lvl.GetTile(index));
|
||||||
|
if (block == lvl.blocks[C.b]) {
|
||||||
if (block == lvl.blocks[C.b])
|
|
||||||
lvl.AddUpdate(index, block, true);
|
lvl.AddUpdate(index, block, true);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
//Change any door blocks nearby into door_air
|
//Change any door blocks nearby into door_air
|
||||||
|
Loading…
x
Reference in New Issue
Block a user