summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorshennetsind <ind@henn.et>2013-06-01 16:15:00 -0300
committershennetsind <ind@henn.et>2013-06-01 16:15:00 -0300
commit3a3d37f5950c5236aac557fbe34a5524fbcda591 (patch)
treefe0f9099f152316d05f0d78b7e1909791efbb0a2 /src
parent7c1447b414fe0ca732edc89013730a2bcb755dd9 (diff)
downloadhercules-3a3d37f5950c5236aac557fbe34a5524fbcda591.tar.gz
hercules-3a3d37f5950c5236aac557fbe34a5524fbcda591.tar.bz2
hercules-3a3d37f5950c5236aac557fbe34a5524fbcda591.tar.xz
hercules-3a3d37f5950c5236aac557fbe34a5524fbcda591.zip
Fixed Map Zone/ID/Index Bug
Special Thanks to Zopokx for bringing this up! Signed-off-by: shennetsind <ind@henn.et>
Diffstat (limited to 'src')
-rw-r--r--src/map/map.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/map/map.c b/src/map/map.c
index 54646d1c3..927ad7970 100644
--- a/src/map/map.c
+++ b/src/map/map.c
@@ -150,7 +150,7 @@ struct map_cache_map_info {
int32 len;
};
-uint16 index2mapid[MAX_MAPINDEX];
+int16 index2mapid[MAX_MAPINDEX];
char db_path[256] = "db";
char help_txt[256] = "conf/help.txt";
@@ -2351,7 +2351,7 @@ int16 map_mapindex2mapid(unsigned short mapindex) {
if (!mapindex || mapindex > MAX_MAPINDEX)
return -1;
- return index2mapid[mapindex] == 0 ? -1 : index2mapid[mapindex];
+ return index2mapid[mapindex];
}
/*==========================================
@@ -3275,7 +3275,7 @@ void map_addmap2db(struct map_data *m) {
}
void map_removemapdb(struct map_data *m) {
- index2mapid[m->index] = 0;
+ index2mapid[m->index] = -1;
}
/*======================================
@@ -3326,7 +3326,7 @@ int map_readallmaps (void) {
map[i].index = mapindex_name2id(map[i].name);
- if ( index2mapid[map[i].index] != 0 ) {
+ if ( index2mapid[map[i].index] != -1 ) {
ShowWarning("Map %s already loaded!"CL_CLL"\n", map[i].name);
if (map[i].cell && map[i].cell != (struct mapcell *)0xdeadbeaf) {
aFree(map[i].cell);
@@ -5435,7 +5435,7 @@ int do_init(int argc, char *argv[])
exit(EXIT_FAILURE);
}
}
- memset(&index2mapid, 0, sizeof(index2mapid));
+ memset(&index2mapid, -1, sizeof(index2mapid));
load_defaults();
map_config_read(MAP_CONF_NAME);