summaryrefslogtreecommitdiff
path: root/src/map/pc.c
diff options
context:
space:
mode:
authorultramage <ultramage@54d463be-8e91-2dee-dedb-b68131a5f0ec>2008-02-27 14:17:14 +0000
committerultramage <ultramage@54d463be-8e91-2dee-dedb-b68131a5f0ec>2008-02-27 14:17:14 +0000
commitbfdb9f0246ab4f774e612f6cc34524e35a113d88 (patch)
tree6198262d6f9f8b5ec9dae23732c5cd55fb540a9a /src/map/pc.c
parentd1a2dd2086001923ef54f4a2c84b569b6a36da00 (diff)
downloadhercules-bfdb9f0246ab4f774e612f6cc34524e35a113d88.tar.gz
hercules-bfdb9f0246ab4f774e612f6cc34524e35a113d88.tar.bz2
hercules-bfdb9f0246ab4f774e612f6cc34524e35a113d88.tar.xz
hercules-bfdb9f0246ab4f774e612f6cc34524e35a113d88.zip
* Removed NODAMAGE and ICEWALL cell types (mem usage back to normal)
- Icewall now uses basic cell type 5 (nonwalkable, shootable) - as a consequence, you can now warp to a nonwalkable cell - but only via gm command or scripted warp bug (hopefully :) git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@12247 54d463be-8e91-2dee-dedb-b68131a5f0ec
Diffstat (limited to 'src/map/pc.c')
-rw-r--r--src/map/pc.c20
1 files changed, 8 insertions, 12 deletions
diff --git a/src/map/pc.c b/src/map/pc.c
index 1d4b9feb6..0dbc8c076 100644
--- a/src/map/pc.c
+++ b/src/map/pc.c
@@ -3426,18 +3426,14 @@ int pc_setpos(struct map_session_data* sd, unsigned short mapindex, int x, int y
return 0;
}
- if(x <0 || x >= map[m].xs || y <0 || y >= map[m].ys)
- x=y=0;
- if((x==0 && y==0) ||
- (map_getcell(m, x, y, CELL_CHKNOPASS) &&
-#ifdef CELL_NOSTACK
- !map_getcell(m, x, y, CELL_CHKSTACK) &&
-#endif
- !map_getcell(m, x, y, CELL_CHKICEWALL))
- ){ //It is allowed on top of Moonlight/icewall tiles to prevent force-warping 'cheats' [Skotlex]
- if(x||y) {
- ShowError("pc_setpos: attempt to place player %s (%d:%d) on non-walkable tile (%s-%d,%d)\n", sd->status.name, sd->status.account_id, sd->status.char_id, mapindex_id2name(mapindex),x,y);
- }
+ if( x < 0 || x >= map[m].xs || y < 0 || y >= map[m].ys )
+ {
+ ShowError("pc_setpos: attempt to place player %s (%d:%d) on invalid coordinates (%s-%d,%d)\n", sd->status.name, sd->status.account_id, sd->status.char_id, mapindex_id2name(mapindex),x,y);
+ x = y = 0; // make it random
+ }
+
+ if( x == 0 && y == 0 )
+ {// pick a random walkable cell
do {
x=rand()%(map[m].xs-2)+1;
y=rand()%(map[m].ys-2)+1;