summaryrefslogtreecommitdiff
path: root/src/map/npc.c
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2015-09-24 14:33:37 +0300
committerAndrei Karas <akaras@inbox.ru>2015-09-24 15:27:07 +0300
commitf94190251bc199582d819fefa448b32a662a297a (patch)
tree9da8729c5c2e7a20a5a355d520872897b5f7f9e2 /src/map/npc.c
parent6b135d6fbda3e033712ab2a5dafe0c97f536cf3c (diff)
downloadhercules-f94190251bc199582d819fefa448b32a662a297a.tar.gz
hercules-f94190251bc199582d819fefa448b32a662a297a.tar.bz2
hercules-f94190251bc199582d819fefa448b32a662a297a.tar.xz
hercules-f94190251bc199582d819fefa448b32a662a297a.zip
Add bl parameter to getcell functions.
Diffstat (limited to 'src/map/npc.c')
-rw-r--r--src/map/npc.c16
1 files changed, 8 insertions, 8 deletions
diff --git a/src/map/npc.c b/src/map/npc.c
index 7428070ab..fe7ba693f 100644
--- a/src/map/npc.c
+++ b/src/map/npc.c
@@ -1099,7 +1099,7 @@ int npc_check_areanpc(int flag, int16 m, int16 x, int16 y, int16 range) {
i = 0;
for (ys = y0; ys <= y1 && !i; ys++) {
for(xs = x0; xs <= x1 && !i; xs++) {
- if (map->getcell(m,xs,ys,CELL_CHKNPC))
+ if (map->getcell(m, NULL, xs, ys, CELL_CHKNPC))
i = 1;
}
}
@@ -3300,7 +3300,7 @@ void npc_setcells(struct npc_data* nd) {
for (i = y-ys; i <= y+ys; i++) {
for (j = x-xs; j <= x+xs; j++) {
- if (map->getcell(m, j, i, CELL_CHKNOPASS))
+ if (map->getcell(m, &nd->bl, j, i, CELL_CHKNOPASS))
continue;
map->list[m].setcell(m, j, i, CELL_NPC, true);
}
@@ -3337,10 +3337,10 @@ void npc_unsetcells(struct npc_data* nd) {
//Locate max range on which we can locate npc cells
//FIXME: does this really do what it's supposed to do? [ultramage]
- for(x0 = x-xs; x0 > 0 && map->getcell(m, x0, y, CELL_CHKNPC); x0--);
- for(x1 = x+xs; x1 < map->list[m].xs-1 && map->getcell(m, x1, y, CELL_CHKNPC); x1++);
- for(y0 = y-ys; y0 > 0 && map->getcell(m, x, y0, CELL_CHKNPC); y0--);
- for(y1 = y+ys; y1 < map->list[m].ys-1 && map->getcell(m, x, y1, CELL_CHKNPC); y1++);
+ for(x0 = x-xs; x0 > 0 && map->getcell(m, &nd->bl, x0, y, CELL_CHKNPC); x0--);
+ for(x1 = x+xs; x1 < map->list[m].xs-1 && map->getcell(m, &nd->bl, x1, y, CELL_CHKNPC); x1++);
+ for(y0 = y-ys; y0 > 0 && map->getcell(m, &nd->bl, x, y0, CELL_CHKNPC); y0--);
+ for(y1 = y+ys; y1 < map->list[m].ys-1 && map->getcell(m, &nd->bl, x, y1, CELL_CHKNPC); y1++);
//Erase this npc's cells
for (i = y-ys; i <= y+ys; i++)
@@ -4580,14 +4580,14 @@ void npc_debug_warps_sub(struct npc_data* nd) {
if (m < 0) return; //Warps to another map, nothing to do about it.
if (nd->u.warp.x == 0 && nd->u.warp.y == 0) return; // random warp
- if (map->getcell(m, nd->u.warp.x, nd->u.warp.y, CELL_CHKNPC)) {
+ if (map->getcell(m, &nd->bl, nd->u.warp.x, nd->u.warp.y, CELL_CHKNPC)) {
ShowWarning("Warp %s at %s(%d,%d) warps directly on top of an area npc at %s(%d,%d)\n",
nd->name,
map->list[nd->bl.m].name, nd->bl.x, nd->bl.y,
map->list[m].name, nd->u.warp.x, nd->u.warp.y
);
}
- if (map->getcell(m, nd->u.warp.x, nd->u.warp.y, CELL_CHKNOPASS)) {
+ if (map->getcell(m, &nd->bl, nd->u.warp.x, nd->u.warp.y, CELL_CHKNOPASS)) {
ShowWarning("Warp %s at %s(%d,%d) warps to a non-walkable tile at %s(%d,%d)\n",
nd->name,
map->list[nd->bl.m].name, nd->bl.x, nd->bl.y,