diff options
author | Ibrahem Hossam <ibrahem.h.basyone@gmail.com> | 2016-12-02 11:50:39 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2016-12-02 11:50:39 +0200 |
commit | fb0b03305568f0ef96564038120fd4a2d8385a85 (patch) | |
tree | e7ca56725cbcdf885e251e754ff93830e38f7a0c /src | |
parent | 017c388c94effffa838d0ffb2e823c805b91a1b2 (diff) | |
parent | 9c2d186e524e436aa6e26bc6358dfaf67e038119 (diff) | |
download | hercules-fb0b03305568f0ef96564038120fd4a2d8385a85.tar.gz hercules-fb0b03305568f0ef96564038120fd4a2d8385a85.tar.bz2 hercules-fb0b03305568f0ef96564038120fd4a2d8385a85.tar.xz hercules-fb0b03305568f0ef96564038120fd4a2d8385a85.zip |
Merge pull request #1521 from Lemongrass3110/fix/areawarp_cellcheck
Fixed areawarp cell check
Diffstat (limited to 'src')
-rw-r--r-- | src/map/script.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/map/script.c b/src/map/script.c index 5ebbf2100..3a81c8075 100644 --- a/src/map/script.c +++ b/src/map/script.c @@ -6391,6 +6391,9 @@ int buildin_areawarp_sub(struct block_list *bl, va_list ap) pc->randomwarp(sd, CLR_TELEPORT); } else if (x3 != 0 && y3 != 0) { int max, tx, ty, j = 0; + int16 m; + + m = map->mapindex2mapid(index); // choose a suitable max number of attempts if( (max = (y3-y2+1)*(x3-x2+1)*3) > 1000 ) @@ -6401,7 +6404,7 @@ int buildin_areawarp_sub(struct block_list *bl, va_list ap) tx = rnd()%(x3-x2+1)+x2; ty = rnd()%(y3-y2+1)+y2; j++; - } while (map->getcell(index, bl, tx, ty, CELL_CHKNOPASS) && j < max); + } while (map->getcell(m, bl, tx, ty, CELL_CHKNOPASS) && j < max); pc->setpos(sd, index, tx, ty, CLR_OUTSIGHT); } else { |