summaryrefslogtreecommitdiff
path: root/src/map
diff options
context:
space:
mode:
authorultramage <ultramage@54d463be-8e91-2dee-dedb-b68131a5f0ec>2007-05-05 13:57:07 +0000
committerultramage <ultramage@54d463be-8e91-2dee-dedb-b68131a5f0ec>2007-05-05 13:57:07 +0000
commit9dc87bf9db25237ae4d904f92311352e6171d372 (patch)
treefe58100dd34d6ee12120f5a2d165b84cdb5a3ab2 /src/map
parent0782cabc543c151f724f38f5132ab948f6346af4 (diff)
downloadhercules-9dc87bf9db25237ae4d904f92311352e6171d372.tar.gz
hercules-9dc87bf9db25237ae4d904f92311352e6171d372.tar.bz2
hercules-9dc87bf9db25237ae4d904f92311352e6171d372.tar.xz
hercules-9dc87bf9db25237ae4d904f92311352e6171d372.zip
- imported the latest working grfio code from stable
- re-added usage of managed allocation routines in grfio - eol-styled some new files - some cosmetic fixes here and there git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@10468 54d463be-8e91-2dee-dedb-b68131a5f0ec
Diffstat (limited to 'src/map')
-rw-r--r--src/map/map.c19
-rw-r--r--src/map/map.h11
-rw-r--r--src/map/npc.c8
-rw-r--r--src/map/pc.c2
-rw-r--r--src/map/status.h48
-rw-r--r--src/map/trade.c2
6 files changed, 35 insertions, 55 deletions
diff --git a/src/map/map.c b/src/map/map.c
index c65e49d21..ca2fd6565 100644
--- a/src/map/map.c
+++ b/src/map/map.c
@@ -2856,24 +2856,17 @@ int map_config_read(char *cfgName) {
} else if(strcmpi(w1,"db_path") == 0) {
strncpy(db_path,w2,255);
} else if (strcmpi(w1, "console") == 0) {
- if(strcmpi(w2,"on") == 0 || strcmpi(w2,"yes") == 0 ) {
- console = 1;
+ console = config_switch(w2);
+ if (console)
ShowNotice("Console Commands are enabled.\n");
- }
} else if (strcmpi(w1, "enable_spy") == 0) {
- if(strcmpi(w2,"on") == 0 || strcmpi(w2,"yes") == 0 )
- enable_spy = 1;
- else
- enable_spy = 0;
- } else if (strcmpi(w1, "use_grf") == 0) { //[blackhole89]
- if(strcmpi(w2,"on") == 0 || strcmpi(w2,"yes") == 0 )
- enable_grf = 1;
- else
- enable_grf = 0;
+ enable_spy = config_switch(w2);
+ } else if (strcmpi(w1, "use_grf") == 0) {
+ enable_grf = config_switch(w2);
} else if (strcmpi(w1, "import") == 0) {
map_config_read(w2);
} else
- ShowWarning("Unknown setting [%s] in file %s\n", w1, cfgName);
+ ShowWarning("Unknown setting '%s' in file %s\n", w1, cfgName);
}
}
fclose(fp);
diff --git a/src/map/map.h b/src/map/map.h
index a2bf8d455..6178b364d 100644
--- a/src/map/map.h
+++ b/src/map/map.h
@@ -1271,12 +1271,6 @@ extern char db_path[256];
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 int map_read_flag; // 0: grfիE1: ëE2: ëE?)
-enum {
- READ_FROM_GAT, READ_FROM_AFM,
- READ_FROM_BITMAP, CREATE_BITMAP,
- READ_FROM_BITMAP_COMPRESSED, CREATE_BITMAP_COMPRESSED
-};
extern char motd_txt[];
extern char help_txt[];
@@ -1356,11 +1350,6 @@ int map_check_dir(int s_dir,int t_dir);
int map_calc_dir( struct block_list *src,int x,int y);
int map_random_dir(struct block_list *bl, short *x, short *y); // [Skotlex]
-// Water functions...
-//
-int map_setwaterheight(int m, char *mapname, int height);
-int map_waterheight(char *mapname);
-
// path.c
int path_search_real(struct walkpath_data *wpd,int m,int x0,int y0,int x1,int y1,int flag,cell_t flag2);
#define path_search(wpd,m,x0,y0,x1,y1,flag) path_search_real(wpd,m,x0,y0,x1,y1,flag,CELL_CHKNOPASS)
diff --git a/src/map/npc.c b/src/map/npc.c
index 97034402e..49cb4f1a0 100644
--- a/src/map/npc.c
+++ b/src/map/npc.c
@@ -2930,7 +2930,6 @@ static int npc_read_event_script_sub(DBKey key,void *data,va_list ap)
void npc_read_event_script(void)
{
int i;
- unsigned char buf[64]="::";
struct {
char *name;
char *event_name;
@@ -2946,15 +2945,14 @@ void npc_read_event_script(void)
};
for (i = 0; i < NPCE_MAX; i++) {
- if (script_event[i].nd)
- script_event[i].nd = NULL;
- if (script_event[i].event_count)
- script_event[i].event_count = 0;
+ script_event[i].nd = NULL;
+ script_event[i].event_count = 0;
if (!script_config.event_script_type) {
//Use a single NPC as event source.
script_event[i].nd = npc_name2id(config[i].event_name);
} else {
//Use an array of Events
+ char buf[64]="::";
strncpy(buf+2,config[i].event_name,62);
ev_db->foreach(ev_db,npc_read_event_script_sub,buf,
&script_event[i].event,
diff --git a/src/map/pc.c b/src/map/pc.c
index ae2914b6f..dd031aadb 100644
--- a/src/map/pc.c
+++ b/src/map/pc.c
@@ -2966,7 +2966,7 @@ int pc_isUseitem(struct map_session_data *sd,int n)
//Butterfly Wing (can't use noreturn flag is on)
if(nameid == 602 && map[sd->bl.m].flag.noreturn)
return 0;
- //Dead Branch & Red Pouch & Bloody Branch & Porings Box (can't use at GVG and when nobranch flag is on)
+ //Dead Branch & Red Pouch & Bloody Branch & Poring Box (can't use at GVG and when nobranch flag is on)
if((nameid == 604 || nameid == 12024 || nameid == 12103 || nameid == 12109) && (map[sd->bl.m].flag.nobranch || map_flag_gvg(sd->bl.m)))
return 0;
diff --git a/src/map/status.h b/src/map/status.h
index 0ea31cdec..380694eba 100644
--- a/src/map/status.h
+++ b/src/map/status.h
@@ -258,14 +258,14 @@ enum {
SC_CHANGE,
SC_BLOODLUST,
SC_FLEET,
- SC_SPEED, //[orn]
- SC_DEFENCE, //[orn]
+ SC_SPEED,
+ SC_DEFENCE,
SC_INCAGIRATE,
SC_INCDEXRATE,
SC_JAILED,
SC_ENCHANTARMS, //250
SC_MAGICALATTACK,
- SC_MAX, //Automatically updated max, used in for's and at startup to check we are within bounds. [Skotlex]
+ SC_MAX, //Automatically updated max, used in for's to check we are within bounds.
};
int SkillStatusChangeTable(int skill);
extern int StatusSkillChangeTable[SC_MAX];
@@ -314,8 +314,8 @@ enum {
//38: Again Aspd Potion
//39: Again Aspd Potion
//40: Again Aspd Potion
- SI_SPEEDPOTION1 = 41,
- SI_SPEEDPOTION2 = 42,
+ SI_SPEEDPOTION1 = 41,
+ SI_SPEEDPOTION2 = 42,
SI_STRIPWEAPON = 50,
SI_STRIPSHIELD = 51,
SI_STRIPARMOR = 52,
@@ -336,7 +336,7 @@ enum {
SI_WATERWEAPON = 91,
SI_WINDWEAPON = 92,
SI_EARTHWEAPON = 93,
- SI_UNDEAD = 97,
+ SI_UNDEAD = 97,
// 102 = again gloria - from what I saw on screenshots, I wonder if it isn't gospel... [DracoRPG]
SI_AURABLADE = 103,
SI_PARRYING = 104,
@@ -344,7 +344,7 @@ enum {
SI_TENSIONRELAX = 106,
SI_BERSERK = 107,
SI_ASSUMPTIO = 110,
- SI_LANDENDOW = 112,
+ SI_LANDENDOW = 112,
SI_MAGICPOWER = 113,
SI_EDP = 114,
SI_TRUESIGHT = 115,
@@ -359,7 +359,7 @@ enum {
SI_BLEEDING = 124,
SI_JOINTBEAT = 125,
SI_BABY = 130,
- SI_AUTOBERSERK = 132,
+ SI_AUTOBERSERK = 132,
SI_RUN = 133,
SI_BUMP = 134,
SI_READYSTORM = 135,
@@ -368,7 +368,7 @@ enum {
SI_READYCOUNTER = 141,
SI_DODGE = 143,
//SI_RUN = 144, //is not RUN. need info on what this is.
- SI_SPURT = 145,
+ SI_SPURT = 145,
SI_SHADOWWEAPON = 146,
SI_ADRENALINE2 = 147,
SI_GHOSTWEAPON = 148,
@@ -378,7 +378,7 @@ enum {
SI_KAIZEL = 156,
SI_KAAHI = 157,
SI_KAUPE = 158,
- SI_SMA = 159,
+ SI_SMA = 159,
SI_NIGHT = 160,
SI_ONEHAND = 161,
SI_WARM = 165,
@@ -388,8 +388,8 @@ enum {
SI_MOON_COMFORT = 170,
SI_STAR_COMFORT = 171,
SI_PRESERVE = 181,
- SI_INCSTR = 182,
- SI_INTRAVISION = 184,
+ SI_INCSTR = 182,
+ SI_INTRAVISION = 184,
SI_DOUBLECAST = 186,
SI_MAXOVERTHRUST = 188,
SI_TAROT = 191, // the icon allows no doubt... but what is it really used for ?? [DracoRPG]
@@ -401,20 +401,20 @@ enum {
SI_MADNESSCANCEL = 203, //[blackhole89]
SI_GATLINGFEVER = 204,
SI_TKREST = 205, // 205 = Gloria again (but TK- Happy State looks like it)
- SI_UTSUSEMI = 206,
+ SI_UTSUSEMI = 206,
SI_BUNSINJYUTSU = 207,
- SI_NEN = 208,
+ SI_NEN = 208,
SI_ADJUSTMENT = 209,
- SI_ACCURACY = 210,
- SI_FOODSTR = 241,
- SI_FOODAGI = 242,
- SI_FOODVIT = 243,
- SI_FOODDEX = 244,
- SI_FOODINT = 245,
- SI_FOODLUK = 246,
- SI_FOODFLEE = 247,
- SI_FOODHIT = 248,
- SI_FOODCRI = 249,
+ SI_ACCURACY = 210,
+ SI_FOODSTR = 241,
+ SI_FOODAGI = 242,
+ SI_FOODVIT = 243,
+ SI_FOODDEX = 244,
+ SI_FOODINT = 245,
+ SI_FOODLUK = 246,
+ SI_FOODFLEE = 247,
+ SI_FOODHIT = 248,
+ SI_FOODCRI = 249,
};
// JOINTBEAT stackable ailments
diff --git a/src/map/trade.c b/src/map/trade.c
index 41d919daa..f8c939424 100644
--- a/src/map/trade.c
+++ b/src/map/trade.c
@@ -54,7 +54,7 @@ void trade_traderequest(struct map_session_data *sd, struct map_session_data *ta
}
if ((target_sd->trade_partner != 0) || (sd->trade_partner != 0)) {
- clif_tradestart(sd, 2); // person is in another trade
+ clif_tradestart(sd, 2); // person is in another trade
return;
}