diff options
author | celest <celest@54d463be-8e91-2dee-dedb-b68131a5f0ec> | 2004-12-20 18:13:04 +0000 |
---|---|---|
committer | celest <celest@54d463be-8e91-2dee-dedb-b68131a5f0ec> | 2004-12-20 18:13:04 +0000 |
commit | 958273319fea7cdc8b82ec988ae6c235c7657ca2 (patch) | |
tree | 199f7180bd715e3773cf5a19df5f37dc2c977daf /src/map/npc.c | |
parent | 114a63af2cecc309da7e34ddf65e5eb3156126af (diff) | |
download | hercules-958273319fea7cdc8b82ec988ae6c235c7657ca2.tar.gz hercules-958273319fea7cdc8b82ec988ae6c235c7657ca2.tar.bz2 hercules-958273319fea7cdc8b82ec988ae6c235c7657ca2.tar.xz hercules-958273319fea7cdc8b82ec988ae6c235c7657ca2.zip |
* Added auto reading leveluseskillspamount.txt and indoorrswtable.txt
* Added check in grfio.c to prevent crashing
git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/branches/stable@667 54d463be-8e91-2dee-dedb-b68131a5f0ec
Diffstat (limited to 'src/map/npc.c')
-rw-r--r-- | src/map/npc.c | 38 |
1 files changed, 38 insertions, 0 deletions
diff --git a/src/map/npc.c b/src/map/npc.c index d9f515cfd..7b616282f 100644 --- a/src/map/npc.c +++ b/src/map/npc.c @@ -21,6 +21,7 @@ #include "pet.h" #include "battle.h" #include "skill.h" +#include "grfio.h" #include "showmsg.h" #ifdef MEMWATCH @@ -2135,6 +2136,39 @@ static int npc_parse_mapflag(char *w1,char *w2,char *w3,char *w4) return 0; } +static int npc_read_indoors(void) +{ + char *buf,*p; + int s, m; + + buf=grfio_reads("data\\indoorrswtable.txt",&s); + + if(buf==NULL) + return -1; + + buf[s]=0; + for(p=buf;p-buf<s;){ + char buf2[64]; + + if(sscanf(p,"%[^#]#",buf2) == 1){ + char map_name[64] = ""; + strncpy(map_name, buf2, strlen(buf2) - 4); + strcat(map_name, ".gat"); + if ((m = map_mapname2mapid(map_name)) >= 0) + map[m].flag.indoors=1; + } + + p=strchr(p,10); + if(!p) break; + p++; + } + free(buf); + sprintf(tmp_output,"Done reading '"CL_WHITE"%s"CL_RESET"'.\n","data\\indoorrswtable.txt"); + ShowStatus(tmp_output); + + return 0; +} + static int ev_db_final(void *key,void *data,va_list ap) { free(data); @@ -2227,6 +2261,10 @@ int do_init_npc(void) int busy = 0; char c = '-'; + // indoorrswtable.txt and etcinfo.txt [Celest] + npc_read_indoors(); + //npc_read_weather(); + ev_db=strdb_init(24); npcname_db=strdb_init(24); |