diff options
author | ultramage <ultramage@54d463be-8e91-2dee-dedb-b68131a5f0ec> | 2008-01-04 12:41:49 +0000 |
---|---|---|
committer | ultramage <ultramage@54d463be-8e91-2dee-dedb-b68131a5f0ec> | 2008-01-04 12:41:49 +0000 |
commit | ff2dd3a0c696cbcd659837ff736f927fab8937e3 (patch) | |
tree | 03aec2e46cbd950af34cfcb4995580e6a1deeae4 /src/map/map.h | |
parent | 1903717ee1d6f3d7834b8ed807cf40f52364129b (diff) | |
download | hercules-ff2dd3a0c696cbcd659837ff736f927fab8937e3.tar.gz hercules-ff2dd3a0c696cbcd659837ff736f927fab8937e3.tar.bz2 hercules-ff2dd3a0c696cbcd659837ff736f927fab8937e3.tar.xz hercules-ff2dd3a0c696cbcd659837ff736f927fab8937e3.zip |
Modified the map_setcell() code to to use a boolean flag instead of needing SET_ / CLR_ pairs of defines (topic:174323).
Also removed script object 'setcell', added script function 'setcell'.
- Now you can manipulate cell information without needing @loadnpc
- You can also manipulate the terrain ('gat') type itself, using the new cell_walkable, cell_shootable and cell_water constants
(currently the implementation uses bit flags too, so to get the type you want, you need to adjust the flags one by one)
- This breaks current scripts, so please adjust places that use setcell
(also be sure to _only_ use predefined constants, not direct numbers)
- Details can be found in the script reference.
git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@12009 54d463be-8e91-2dee-dedb-b68131a5f0ec
Diffstat (limited to 'src/map/map.h')
-rw-r--r-- | src/map/map.h | 67 |
1 files changed, 29 insertions, 38 deletions
diff --git a/src/map/map.h b/src/map/map.h index ffa4685fc..2eaf4c2c1 100644 --- a/src/map/map.h +++ b/src/map/map.h @@ -1107,48 +1107,39 @@ enum _look { LOOK_SHOES }; -// CELLs for non-permanent cell-based effects (Pneuma, Basilica, Npcs, etc) -#define CELL_NPC 0x1 -#define CELL_LANDPROTECTOR 0x10 -#define CELL_BASILICA 0x20 -#define CELL_NOVENDING 0x40 -#define CELL_ICEWALL 0x80 -/* - * map_getcell()で使用されるフラグ - */ +// used by map_setcell() typedef enum { - CELL_GETTYPE, // セルタイプを返す + CELL_WALKABLE, + CELL_SHOOTABLE, + CELL_WATER, + + CELL_NPC, + CELL_BASILICA, + CELL_LANDPROTECTOR, + CELL_ICEWALL, + CELL_NOVENDING, +} cell_t; + +// used by map_getcell() +typedef enum { + CELL_GETTYPE, // retrieves a cell's 'gat' type - CELL_CHKWALL, // 壁(セルタイプ1) - CELL_CHKWATER, // 水場(セルタイプ3) - CELL_CHKCLIFF, // 地面障害物(セルタイプ5) + CELL_CHKWALL, // wall (gat type 1) + CELL_CHKWATER, // water (gat type 3) + CELL_CHKCLIFF, // cliff/gap (gat type 5) - CELL_CHKPASS, // 通過可能(セルタイプ1,5以外) + CELL_CHKPASS, // passable cell (gat type non-1/5) CELL_CHKREACH, // Same as PASS, but ignores the cell-stacking mod. - CELL_CHKNOPASS, // 通過不可(セルタイプ1,5) + CELL_CHKNOPASS, // non-passable cell (gat types 1 and 5) CELL_CHKNOREACH, // Same as NOPASS, but ignores the cell-stacking mod. + CELL_CHKSTACK, // whether cell is full (reached cell stacking limit) - CELL_CHKNPC=0x10, // タッチタイプのNPC(セルタイプ0x80フラグ) - CELL_CHKBASILICA, // バジリカ(セルタイプ0x40フラグ) + CELL_CHKNPC, + CELL_CHKBASILICA, CELL_CHKLANDPROTECTOR, CELL_CHKICEWALL, - CELL_CHKSTACK, CELL_CHKNOVENDING, -} cell_t; - -// map_setcell()で使用されるフラグ -enum { - CELL_SETNPC=0x10, // タッチタイプのNPCをセット - CELL_CLRNPC, - CELL_SETBASILICA, // バジリカをセット - CELL_CLRBASILICA, // バジリカをクリア - CELL_SETLANDPROTECTOR=0x15, //Set/Clear Magnetic Earth - CELL_CLRLANDPROTECTOR, - CELL_SETICEWALL=0x1b, - CELL_CLRICEWALL, - CELL_SETNOVENDING, - CELL_CLRNOVENDING, -}; +} cell_chk; struct mapcell { @@ -1254,8 +1245,13 @@ struct map_data_other_server { uint16 port; }; +int map_getcell(int,int,int,cell_chk); +int map_getcellp(struct map_data*,int,int,cell_chk); +void map_setcell(int m, int x, int y, cell_t cell, bool flag); + extern struct map_data map[]; extern int map_num; + extern int autosave_interval; extern int minsave_interval; extern int save_settings; @@ -1264,11 +1260,6 @@ extern int night_flag; // 0=day, 1=night [Yor] extern int enable_spy; //Determines if @spy commands are active. extern char db_path[256]; -// gat?ヨァ -int map_getcell(int,int,int,cell_t); -int map_getcellp(struct map_data*,int,int,cell_t); -void map_setcell(int,int,int,int); - extern char motd_txt[]; extern char help_txt[]; extern char help2_txt[]; |