mirror of
https://github.com/The-Powder-Toy/The-Powder-Toy.git
synced 2025-04-09 08:52:24 +02:00
Actually use .Properties instead of .Falldown for wall blocking
This commit is contained in:
parent
8630b0a926
commit
adf0fa72df
@ -791,7 +791,7 @@ void GameSave::readOPS(char * data, int dataLength)
|
||||
if (blockMap[y][x]==O_WL_ALLOWAIR)
|
||||
blockMap[y][x]=WL_ALLOWAIR;
|
||||
if (blockMap[y][x]==O_WL_ALLOWSOLID)
|
||||
blockMap[y][x]=WL_ALLOWSOLID;
|
||||
blockMap[y][x]=WL_ALLOWPOWDER;
|
||||
if (blockMap[y][x]==O_WL_ALLOWALLELEC)
|
||||
blockMap[y][x]=WL_ALLOWALLELEC;
|
||||
if (blockMap[y][x]==O_WL_EHOLE)
|
||||
@ -1312,7 +1312,7 @@ void GameSave::readPSv(char * data, int dataLength)
|
||||
else if (blockMap[y][x]==9)
|
||||
blockMap[y][x]=WL_ALLOWAIR;
|
||||
else if (blockMap[y][x]==10)
|
||||
blockMap[y][x]=WL_ALLOWSOLID;
|
||||
blockMap[y][x]=WL_ALLOWPOWDER;
|
||||
else if (blockMap[y][x]==11)
|
||||
blockMap[y][x]=WL_ALLOWALLELEC;
|
||||
else if (blockMap[y][x]==12)
|
||||
@ -1346,7 +1346,7 @@ void GameSave::readPSv(char * data, int dataLength)
|
||||
else if (blockMap[y][x]==O_WL_ALLOWAIR)
|
||||
blockMap[y][x]=WL_ALLOWAIR;
|
||||
else if (blockMap[y][x]==O_WL_ALLOWSOLID)
|
||||
blockMap[y][x]=WL_ALLOWSOLID;
|
||||
blockMap[y][x]=WL_ALLOWPOWDER;
|
||||
else if (blockMap[y][x]==O_WL_ALLOWALLELEC)
|
||||
blockMap[y][x]=WL_ALLOWALLELEC;
|
||||
else if (blockMap[y][x]==O_WL_EHOLE)
|
||||
|
@ -1943,7 +1943,7 @@ bool Simulation::IsWallBlocking(int x, int y, int type)
|
||||
return true;
|
||||
else if (wall == WL_ALLOWLIQUID && !(elements[type].Properties&TYPE_LIQUID))
|
||||
return true;
|
||||
else if (wall == WL_ALLOWSOLID && !(elements[type].Properties&TYPE_PART))
|
||||
else if (wall == WL_ALLOWPOWDER && !(elements[type].Properties&TYPE_PART))
|
||||
return true;
|
||||
else if (wall == WL_ALLOWAIR || wall == WL_WALL || wall == WL_WALLELEC)
|
||||
return true;
|
||||
@ -2154,17 +2154,7 @@ int Simulation::eval_move(int pt, int nx, int ny, unsigned *rr)
|
||||
}
|
||||
if (bmap[ny/CELL][nx/CELL])
|
||||
{
|
||||
if (bmap[ny/CELL][nx/CELL]==WL_ALLOWGAS && !(elements[pt].Properties&TYPE_GAS))// && elements[pt].Falldown!=0 && pt!=PT_FIRE && pt!=PT_SMKE)
|
||||
return 0;
|
||||
if (bmap[ny/CELL][nx/CELL]==WL_ALLOWENERGY && !(elements[pt].Properties&TYPE_ENERGY))// && elements[pt].Falldown!=0 && pt!=PT_FIRE && pt!=PT_SMKE)
|
||||
return 0;
|
||||
if (bmap[ny/CELL][nx/CELL]==WL_ALLOWLIQUID && elements[pt].Falldown!=2)
|
||||
return 0;
|
||||
if (bmap[ny/CELL][nx/CELL]==WL_ALLOWSOLID && elements[pt].Falldown!=1)
|
||||
return 0;
|
||||
if (bmap[ny/CELL][nx/CELL]==WL_ALLOWAIR || bmap[ny/CELL][nx/CELL]==WL_WALL || bmap[ny/CELL][nx/CELL]==WL_WALLELEC)
|
||||
return 0;
|
||||
if (bmap[ny/CELL][nx/CELL]==WL_EWALL && !emap[ny/CELL][nx/CELL])
|
||||
if (IsWallBlocking(nx, ny, pt))
|
||||
return 0;
|
||||
if (bmap[ny/CELL][nx/CELL]==WL_EHOLE && !emap[ny/CELL][nx/CELL] && !(elements[pt].Properties&TYPE_SOLID) && !(elements[r&0xFF].Properties&TYPE_SOLID))
|
||||
return 2;
|
||||
@ -3416,8 +3406,8 @@ void Simulation::UpdateParticles(int start, int end)
|
||||
bmap[y/CELL][x/CELL]==WL_WALLELEC ||
|
||||
bmap[y/CELL][x/CELL]==WL_ALLOWAIR ||
|
||||
(bmap[y/CELL][x/CELL]==WL_DESTROYALL) ||
|
||||
(bmap[y/CELL][x/CELL]==WL_ALLOWLIQUID && elements[t].Falldown!=2) ||
|
||||
(bmap[y/CELL][x/CELL]==WL_ALLOWSOLID && elements[t].Falldown!=1) ||
|
||||
(bmap[y/CELL][x/CELL]==WL_ALLOWLIQUID && !(elements[t].Properties&TYPE_LIQUID)) ||
|
||||
(bmap[y/CELL][x/CELL]==WL_ALLOWPOWDER && !(elements[t].Properties&TYPE_PART)) ||
|
||||
(bmap[y/CELL][x/CELL]==WL_ALLOWGAS && !(elements[t].Properties&TYPE_GAS)) || //&& elements[t].Falldown!=0 && parts[i].type!=PT_FIRE && parts[i].type!=PT_SMKE && parts[i].type!=PT_CFLM) ||
|
||||
(bmap[y/CELL][x/CELL]==WL_ALLOWENERGY && !(elements[t].Properties&TYPE_ENERGY)) ||
|
||||
(bmap[y/CELL][x/CELL]==WL_DETECT && (t==PT_METL || t==PT_SPRK)) ||
|
||||
|
@ -48,7 +48,7 @@
|
||||
#define WL_DESTROYALL 7
|
||||
#define WL_WALL 8
|
||||
#define WL_ALLOWAIR 9
|
||||
#define WL_ALLOWSOLID 10
|
||||
#define WL_ALLOWPOWDER 10
|
||||
#define WL_ALLOWALLELEC 11
|
||||
#define WL_EHOLE 12
|
||||
#define WL_ALLOWGAS 13
|
||||
|
Loading…
x
Reference in New Issue
Block a user