summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHaru <haru@dotalux.com>2013-12-11 15:01:00 +0100
committerHaru <haru@dotalux.com>2013-12-11 15:03:52 +0100
commit68d6c8bc110bbecd39c47b0e00445b8b4b5eb278 (patch)
tree98804fe393e6559399e5ff0c86a73026c889a1f8
parent27cf11151de917892b22794c1aa798620a484850 (diff)
downloadhercules-68d6c8bc110bbecd39c47b0e00445b8b4b5eb278.tar.gz
hercules-68d6c8bc110bbecd39c47b0e00445b8b4b5eb278.tar.bz2
hercules-68d6c8bc110bbecd39c47b0e00445b8b4b5eb278.tar.xz
hercules-68d6c8bc110bbecd39c47b0e00445b8b4b5eb278.zip
Corrected some local 'mapindex' variables shadowing the global one
Signed-off-by: Haru <haru@dotalux.com>
-rw-r--r--src/map/battleground.c8
-rw-r--r--src/map/battleground.h4
-rw-r--r--src/map/guild.c4
-rw-r--r--src/map/guild.h2
-rw-r--r--src/map/intif.c8
-rw-r--r--src/map/map.c12
-rw-r--r--src/map/map.h6
-rw-r--r--src/map/mob.h2
-rw-r--r--src/map/pc.c5
-rw-r--r--src/map/pc.h2
-rw-r--r--src/map/script.c18
-rw-r--r--src/map/skill.c2
-rw-r--r--src/map/skill.h2
-rw-r--r--src/map/status.c4
-rw-r--r--src/map/status.h2
15 files changed, 40 insertions, 41 deletions
diff --git a/src/map/battleground.c b/src/map/battleground.c
index 6b9695849..6029a8c35 100644
--- a/src/map/battleground.c
+++ b/src/map/battleground.c
@@ -60,12 +60,12 @@ int bg_team_delete(int bg_id) {
}
/// Warps a Team
-int bg_team_warp(int bg_id, unsigned short mapindex, short x, short y) {
+int bg_team_warp(int bg_id, unsigned short map_index, short x, short y) {
int i;
struct battleground_data *bgd = bg->team_search(bg_id);
if( bgd == NULL ) return 0;
for( i = 0; i < MAX_BG_MEMBERS; i++ )
- if( bgd->members[i].sd != NULL ) pc->setpos(bgd->members[i].sd, mapindex, x, y, CLR_TELEPORT);
+ if( bgd->members[i].sd != NULL ) pc->setpos(bgd->members[i].sd, map_index, x, y, CLR_TELEPORT);
return 1;
}
@@ -168,14 +168,14 @@ int bg_member_respawn(struct map_session_data *sd) {
return 1; // Warped
}
-int bg_create(unsigned short mapindex, short rx, short ry, const char *ev, const char *dev) {
+int bg_create(unsigned short map_index, short rx, short ry, const char *ev, const char *dev) {
struct battleground_data *bgd;
bg->team_counter++;
CREATE(bgd, struct battleground_data, 1);
bgd->bg_id = bg->team_counter;
bgd->count = 0;
- bgd->mapindex = mapindex;
+ bgd->mapindex = map_index;
bgd->x = rx;
bgd->y = ry;
safestrncpy(bgd->logout_event, ev, sizeof(bgd->logout_event));
diff --git a/src/map/battleground.h b/src/map/battleground.h
index 7f15a4bbc..a24ae5ea9 100644
--- a/src/map/battleground.h
+++ b/src/map/battleground.h
@@ -94,12 +94,12 @@ struct battleground_interface {
struct battleground_data* (*team_search) (int bg_id);
struct map_session_data* (*getavailablesd) (struct battleground_data *bgd);
int (*team_delete) (int bg_id);
- int (*team_warp) (int bg_id, unsigned short mapindex, short x, short y);
+ int (*team_warp) (int bg_id, unsigned short map_index, short x, short y);
int (*send_dot_remove) (struct map_session_data *sd);
int (*team_join) (int bg_id, struct map_session_data *sd);
int (*team_leave) (struct map_session_data *sd, int flag);
int (*member_respawn) (struct map_session_data *sd);
- int (*create) (unsigned short mapindex, short rx, short ry, const char *ev, const char *dev);
+ int (*create) (unsigned short map_index, short rx, short ry, const char *ev, const char *dev);
int (*team_get_id) (struct block_list *bl);
int (*send_message) (struct map_session_data *sd, const char *mes, int len);
int (*send_xy_timer_sub) (DBKey key, DBData *data, va_list ap);
diff --git a/src/map/guild.c b/src/map/guild.c
index e73a9323b..66376a2a8 100644
--- a/src/map/guild.c
+++ b/src/map/guild.c
@@ -171,14 +171,14 @@ struct guild_castle* guild_castle_search(int gcid)
}
/// lookup: map index -> castle*
-struct guild_castle* guild_mapindex2gc(short mapindex)
+struct guild_castle* guild_mapindex2gc(short map_index)
{
struct guild_castle* gc;
DBIterator *iter = db_iterator(guild->castle_db);
for( gc = dbi_first(iter); dbi_exists(iter); gc = dbi_next(iter) )
{
- if( gc->mapindex == mapindex )
+ if( gc->mapindex == map_index )
break;
}
dbi_destroy(iter);
diff --git a/src/map/guild.h b/src/map/guild.h
index 1a04a98ef..7878d75c3 100644
--- a/src/map/guild.h
+++ b/src/map/guild.h
@@ -83,7 +83,7 @@ struct guild_interface {
struct guild_castle *(*castle_search) (int gcid);
/* */
struct guild_castle *(*mapname2gc) (const char* mapname);
- struct guild_castle *(*mapindex2gc) (short mapindex);
+ struct guild_castle *(*mapindex2gc) (short map_index);
/* */
struct map_session_data *(*getavailablesd) (struct guild *g);
int (*getindex) (struct guild *g,int account_id,int char_id);
diff --git a/src/map/intif.c b/src/map/intif.c
index 3779eaa21..df7a16db7 100644
--- a/src/map/intif.c
+++ b/src/map/intif.c
@@ -447,7 +447,7 @@ int intif_party_leave(int party_id,int account_id, int char_id)
// Request keeping party for new map ??
int intif_party_changemap(struct map_session_data *sd,int online) {
- int16 m, mapindex;
+ int16 m, map_index;
if (intif->CheckForCharServer())
return 0;
@@ -455,16 +455,16 @@ int intif_party_changemap(struct map_session_data *sd,int online) {
return 0;
if( (m=map->mapindex2mapid(sd->mapindex)) >= 0 && map->list[m].instance_id >= 0 )
- mapindex = map_id2index(map->list[m].instance_src_map);
+ map_index = map_id2index(map->list[m].instance_src_map);
else
- mapindex = sd->mapindex;
+ map_index = sd->mapindex;
WFIFOHEAD(inter_fd,19);
WFIFOW(inter_fd,0)=0x3025;
WFIFOL(inter_fd,2)=sd->status.party_id;
WFIFOL(inter_fd,6)=sd->status.account_id;
WFIFOL(inter_fd,10)=sd->status.char_id;
- WFIFOW(inter_fd,14)=mapindex;
+ WFIFOW(inter_fd,14)=map_index;
WFIFOB(inter_fd,16)=online;
WFIFOW(inter_fd,17)=sd->status.base_level;
WFIFOSET(inter_fd,19);
diff --git a/src/map/map.c b/src/map/map.c
index d70f95dff..b68a1f6a5 100644
--- a/src/map/map.c
+++ b/src/map/map.c
@@ -2339,12 +2339,12 @@ int16 map_mapname2mapid(const char* name) {
/*==========================================
* Returns the map of the given mapindex. [Skotlex]
*------------------------------------------*/
-int16 map_mapindex2mapid(unsigned short mapindex) {
+int16 map_mapindex2mapid(unsigned short map_index) {
- if (!mapindex || mapindex > MAX_MAPINDEX)
+ if (!map_index || map_index > MAX_MAPINDEX)
return -1;
- return map->index2mapid[mapindex];
+ return map->index2mapid[map_index];
}
/*==========================================
@@ -2816,15 +2816,15 @@ int map_eraseallipport(void) {
/*==========================================
* Delete mapindex from db of another map server
*------------------------------------------*/
-int map_eraseipport(unsigned short mapindex, uint32 ip, uint16 port) {
+int map_eraseipport(unsigned short map_index, uint32 ip, uint16 port) {
struct map_data_other_server *mdos;
- mdos = (struct map_data_other_server*)uidb_get(map->map_db,(unsigned int)mapindex);
+ mdos = (struct map_data_other_server*)uidb_get(map->map_db,(unsigned int)map_index);
if(!mdos || mdos->cell) //Map either does not exists or is a local map.
return 0;
if(mdos->ip==ip && mdos->port == port) {
- uidb_remove(map->map_db,(unsigned int)mapindex);
+ uidb_remove(map->map_db,(unsigned int)map_index);
aFree(mdos);
return 1;
}
diff --git a/src/map/map.h b/src/map/map.h
index 6580d7e50..906202f83 100644
--- a/src/map/map.h
+++ b/src/map/map.h
@@ -970,11 +970,11 @@ struct map_interface {
struct chat_data* (*id2cd) (int id);
struct block_list * (*id2bl) (int id);
bool (*blid_exists) (int id);
- int16 (*mapindex2mapid) (unsigned short mapindex);
+ int16 (*mapindex2mapid) (unsigned short map_index);
int16 (*mapname2mapid) (const char* name);
int (*mapname2ipport) (unsigned short name, uint32* ip, uint16* port);
- int (*setipport) (unsigned short mapindex, uint32 ip, uint16 port);
- int (*eraseipport) (unsigned short mapindex, uint32 ip, uint16 port);
+ int (*setipport) (unsigned short map_index, uint32 ip, uint16 port);
+ int (*eraseipport) (unsigned short map_index, uint32 ip, uint16 port);
int (*eraseallipport) (void);
void (*addiddb) (struct block_list *bl);
void (*deliddb) (struct block_list *bl);
diff --git a/src/map/mob.h b/src/map/mob.h
index 48a9f078e..605a8b465 100644
--- a/src/map/mob.h
+++ b/src/map/mob.h
@@ -270,7 +270,7 @@ struct mob_interface {
int (*spawn_guardian_sub) (int tid, int64 tick, int id, intptr_t data);
int (*skill_id2skill_idx) (int class_, uint16 skill_id);
int (*db_searchname) (const char *str);
- int (*db_searchname_array_sub) (struct mob_db *mob, const char *str, int flag);
+ int (*db_searchname_array_sub) (struct mob_db *monster, const char *str, int flag);
// MvP Tomb System
void (*mvptomb_create) (struct mob_data *md, char *killer, time_t time);
void (*mvptomb_destroy) (struct mob_data *md);
diff --git a/src/map/pc.c b/src/map/pc.c
index 7c3df2262..ab5749eb1 100644
--- a/src/map/pc.c
+++ b/src/map/pc.c
@@ -9382,11 +9382,10 @@ void pc_regen (struct map_session_data *sd, unsigned int diff_tick) {
/*==========================================
* Memo player sd savepoint. (map,x,y)
*------------------------------------------*/
-int pc_setsavepoint(struct map_session_data *sd, short mapindex,int x,int y)
-{
+int pc_setsavepoint(struct map_session_data *sd, short map_index, int x, int y) {
nullpo_ret(sd);
- sd->status.save_point.map = mapindex;
+ sd->status.save_point.map = map_index;
sd->status.save_point.x = x;
sd->status.save_point.y = y;
diff --git a/src/map/pc.h b/src/map/pc.h
index 90e1357cf..3de1e35fe 100644
--- a/src/map/pc.h
+++ b/src/map/pc.h
@@ -786,7 +786,7 @@ struct pc_interface {
int (*clean_skilltree) (struct map_session_data *sd);
int (*setpos) (struct map_session_data* sd, unsigned short map_index, int x, int y, clr_type clrtype);
- int (*setsavepoint) (struct map_session_data *sd, short mapindex,int x,int y);
+ int (*setsavepoint) (struct map_session_data *sd, short map_index, int x, int y);
int (*randomwarp) (struct map_session_data *sd,clr_type type);
int (*memo) (struct map_session_data* sd, int pos);
diff --git a/src/map/script.c b/src/map/script.c
index 1da6fb1c2..008298fa3 100644
--- a/src/map/script.c
+++ b/src/map/script.c
@@ -10506,7 +10506,7 @@ BUILDIN(setmapflagnosave) {
m = map->mapname2mapid(str);
map_index = mapindex->name2id(str2);
- if(m >= 0 && mapindex) {
+ if(m >= 0 && map_index) {
map->list[m].flag.nosave=1;
map->list[m].save.map=map_index;
map->list[m].save.x=x;
@@ -15839,13 +15839,13 @@ BUILDIN(readbook)
BUILDIN(questinfo)
{
struct npc_data *nd = map->id2nd(st->oid);
- int quest, icon, job, color = 0;
+ int quest_id, icon, job, color = 0;
struct questinfo qi;
if( nd == NULL || nd->bl.m == -1 )
return true;
- quest = script_getnum(st, 2);
+ quest_id = script_getnum(st, 2);
icon = script_getnum(st, 3);
#if PACKETVER >= 20120410
@@ -15858,7 +15858,7 @@ BUILDIN(questinfo)
icon = icon + 1;
#endif
- qi.quest_id = quest;
+ qi.quest_id = quest_id;
qi.icon = (unsigned char)icon;
qi.nd = nd;
@@ -16502,11 +16502,11 @@ BUILDIN(has_instance) {
}
int buildin_instance_warpall_sub(struct block_list *bl,va_list ap) {
struct map_session_data *sd = ((TBL_PC*)bl);
- int mapindex = va_arg(ap,int);
+ int map_index = va_arg(ap,int);
int x = va_arg(ap,int);
int y = va_arg(ap,int);
- pc->setpos(sd,mapindex,x,y,CLR_TELEPORT);
+ pc->setpos(sd,map_index,x,y,CLR_TELEPORT);
return 0;
}
@@ -16515,7 +16515,7 @@ BUILDIN(instance_warpall) {
int instance_id = -1;
const char *mapn;
int x, y;
- int mapindex;
+ int map_index;
mapn = script_getstr(st,2);
x = script_getnum(st,3);
@@ -16531,9 +16531,9 @@ BUILDIN(instance_warpall) {
if( (m = map->mapname2mapid(mapn)) < 0 || (map->list[m].flag.src4instance && (m = instance->mapid2imapid(m, instance_id)) < 0) )
return true;
- mapindex = map_id2index(m);
+ map_index = map_id2index(m);
- map->foreachininstance(script->buildin_instance_warpall_sub, instance_id, BL_PC,mapindex,x,y);
+ map->foreachininstance(script->buildin_instance_warpall_sub, instance_id, BL_PC,map_index,x,y);
return true;
}
diff --git a/src/map/skill.c b/src/map/skill.c
index 2eda450a7..650594abc 100644
--- a/src/map/skill.c
+++ b/src/map/skill.c
@@ -9584,7 +9584,7 @@ int skill_castend_map (struct map_session_data *sd, uint16 skill_id, const char
unsigned short map_index;
map_index = mapindex->name2id(mapname);
- if(!mapindex) { //Given map not found?
+ if(!map_index) { //Given map not found?
clif->skill_fail(sd,skill_id,USESKILL_FAIL_LEVEL,0);
skill_failed(sd);
return 0;
diff --git a/src/map/skill.h b/src/map/skill.h
index 1b6f1e24c..28cb548d2 100644
--- a/src/map/skill.h
+++ b/src/map/skill.h
@@ -1871,7 +1871,7 @@ struct skill_interface {
int (*get_casttype) (uint16 skill_id);
int (*get_casttype2) (uint16 index);
int (*name2id) (const char* name);
- int (*isammotype) (struct map_session_data *sd, int skill);
+ int (*isammotype) (struct map_session_data *sd, int skill_id);
int (*castend_id) (int tid, int64 tick, int id, intptr_t data);
int (*castend_pos) (int tid, int64 tick, int id, intptr_t data);
int (*castend_map) ( struct map_session_data *sd,uint16 skill_id, const char *mapname);
diff --git a/src/map/status.c b/src/map/status.c
index 7e16faeeb..ed29bacf9 100644
--- a/src/map/status.c
+++ b/src/map/status.c
@@ -7959,11 +7959,11 @@ int status_change_start(struct block_list* bl,enum sc_type type,int rate,int val
if (sd->mapindex != val2)
{
int pos = (bl->x&0xFFFF)|(bl->y<<16); /// Current Coordinates
- int mapindex = sd->mapindex; /// Current Map
+ int map_index = sd->mapindex; /// Current Map
//1. Place in Jail (val2 -> Jail Map, val3 -> x, val4 -> y
pc->setpos(sd,(unsigned short)val2,val3,val4, CLR_TELEPORT);
//2. Set restore point (val3 -> return map, val4 return coords
- val3 = mapindex;
+ val3 = map_index;
val4 = pos;
} else if (!val3 || val3 == sd->mapindex) { //Use save point.
val3 = sd->status.save_point.map;
diff --git a/src/map/status.h b/src/map/status.h
index 75582e9a4..2a281aef4 100644
--- a/src/map/status.h
+++ b/src/map/status.h
@@ -1925,7 +1925,7 @@ struct status_interface {
int (*calc_homunculus_) (struct homun_data *hd, enum e_status_calc_opt opt);
int (*calc_mercenary_) (struct mercenary_data *md, enum e_status_calc_opt opt);
int (*calc_elemental_) (struct elemental_data *ed, enum e_status_calc_opt opt);
- void (*calc_misc) (struct block_list *bl, struct status_data *status, int level);
+ void (*calc_misc) (struct block_list *bl, struct status_data *st, int level);
void (*calc_regen) (struct block_list *bl, struct status_data *st, struct regen_data *regen);
void (*calc_regen_rate) (struct block_list *bl, struct regen_data *regen, struct status_change *sc);
int (*check_skilluse) (struct block_list *src, struct block_list *target, uint16 skill_id, int flag); // [Skotlex]