diff options
author | Andrei Karas <akaras@inbox.ru> | 2015-10-03 23:13:37 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2015-10-03 23:13:37 +0300 |
commit | bc5cd40bdf2fe9a37af83c2fb23fc8911c0b2ee1 (patch) | |
tree | e94a2d2c257ce392c37f7c152fba0339c33a9d1f /src | |
parent | d9f34370343f92a966d7b16651e2af03db065683 (diff) | |
download | plugin-bc5cd40bdf2fe9a37af83c2fb23fc8911c0b2ee1.tar.gz plugin-bc5cd40bdf2fe9a37af83c2fb23fc8911c0b2ee1.tar.bz2 plugin-bc5cd40bdf2fe9a37af83c2fb23fc8911c0b2ee1.tar.xz plugin-bc5cd40bdf2fe9a37af83c2fb23fc8911c0b2ee1.zip |
Add wall separate cell property.
Diffstat (limited to 'src')
-rw-r--r-- | src/emap/map.c | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/src/emap/map.c b/src/emap/map.c index 05f5a7c..7723d4f 100644 --- a/src/emap/map.c +++ b/src/emap/map.c @@ -46,6 +46,7 @@ struct mapcell2 icewall : 1, noicewall : 1, + wall : 1, air : 1; #ifdef CELL_NOSTACK @@ -195,7 +196,7 @@ static bool isWalkCell(const struct block_list *bl, struct mapcell2 cell) if ((cell.air || cell.water) && walkMask & 0x4) return true; // wall check - if (!cell.walkable && !cell.shootable && walkMask & 0x1) + if (cell.wall && walkMask & 0x1) return true; // other checks return false; @@ -212,7 +213,7 @@ static bool isWallCell(const struct block_list *bl, struct mapcell2 cell) if ((cell.air || cell.water) && walkMask & 0x4) return false; // wall check - if (!cell.walkable && !cell.shootable && && walkMask & 0x1) + if (cell.wall && walkMask & 0x1) return false; return true; } @@ -289,30 +290,35 @@ struct mapcell emap_gat2cell(int *gatPtr) cell.shootable = 1; cell.water = 0; cell.air = 0; + cell.wall = 0; break; case 1: // wall cell.walkable = 0; cell.shootable = 0; cell.water = 0; cell.air = 0; + cell.wall = 1; break; case 2: // air allowed cell.walkable = 0; cell.shootable = 0; cell.water = 0; cell.air = 1; + cell.wall = 0; break; case 3: // unwalkable water cell.walkable = 0; cell.shootable = 1; cell.water = 1; cell.air = 0; + cell.wall = 0; break; case 4: // sit, walkable ground cell.walkable = 1; cell.shootable = 1; cell.water = 0; cell.air = 0; + cell.wall = 0; break; default: ShowWarning("map_gat2cell: unrecognized gat type '%d'\n", gat); @@ -364,4 +370,5 @@ void emap_setgatcell(int16 *mPtr, int16 *xPtr, int16 *yPtr, int *gatPtr) cell2->shootable = cell->shootable; cell2->water = cell->water; cell2->air = cell->air; + cell2->wall = cell->wall; } |