summaryrefslogtreecommitdiff
path: root/src/map/map.c
diff options
context:
space:
mode:
authormc_cameri <mc_cameri@54d463be-8e91-2dee-dedb-b68131a5f0ec>2004-12-14 00:33:01 +0000
committermc_cameri <mc_cameri@54d463be-8e91-2dee-dedb-b68131a5f0ec>2004-12-14 00:33:01 +0000
commit4aee20b0e1fdfb23d9336cea77a0985e463ea081 (patch)
tree0cca8570cea1e328d527952640287db50de5d6f6 /src/map/map.c
parentc9e34e95d3d79d28927300684aaab6940fd03c9e (diff)
downloadhercules-4aee20b0e1fdfb23d9336cea77a0985e463ea081.tar.gz
hercules-4aee20b0e1fdfb23d9336cea77a0985e463ea081.tar.bz2
hercules-4aee20b0e1fdfb23d9336cea77a0985e463ea081.tar.xz
hercules-4aee20b0e1fdfb23d9336cea77a0985e463ea081.zip
git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/branches/stable@566 54d463be-8e91-2dee-dedb-b68131a5f0ec
Diffstat (limited to 'src/map/map.c')
-rw-r--r--src/map/map.c44
1 files changed, 36 insertions, 8 deletions
diff --git a/src/map/map.c b/src/map/map.c
index 282d2795b..c00845158 100644
--- a/src/map/map.c
+++ b/src/map/map.c
@@ -104,6 +104,8 @@ static int online_timer(int,unsigned int,int,int);
int CHECK_INTERVAL = 3600000; // [Valaris]
int check_online_timer=0; // [Valaris]
+static int pos = 0;
+
#endif /* not TXT_ONLY */
#define USE_AFM
@@ -1588,16 +1590,26 @@ static int map_readmap(int m,char *fn, char *alias) {
int x,y,xs,ys;
struct gat_1cell {float high[4]; int type;} *p=NULL;
int wh;
+ int i;
+ int e = 0;
+
size_t size;
-
+ char progress[21] = " ";
// read & convert fn
gat=grfio_read(fn);
if(gat==NULL)
return -1;
-
- printf("\rLoading Maps [%d/%d]: %-50s ",m,map_num,fn);
- fflush(stdout);
-
+ //printf("\rLoading Maps [%d/%d]: %-50s ",m,map_num,fn);
+ if (map_num) { //avoid map-server crashing if there are 0 maps
+ printf("\r");
+ ShowStatus("Progress: ");
+ i=m*20/420;
+ printf("[");
+ for (e=0;e<i;e++) progress[e] = '#';
+ printf(progress);
+ printf("] Working: [");
+ fflush(stdout);
+ }
map[m].m=m;
xs=map[m].xs=*(int*)(gat+6);
ys=map[m].ys=*(int*)(gat+10);
@@ -1645,8 +1657,12 @@ static int map_readmap(int m,char *fn, char *alias) {
*------------------------------------------
*/
int map_readallmap(void) {
+ ShowStatus("Loading Maps...\n");
int i,maps_removed=0;
char fn[256];
+ char c = '-';
+ time_t last_time = time(0);
+ int busy = 0;
#ifdef USE_AFM
FILE *afm_file;
#endif
@@ -1681,16 +1697,28 @@ int map_readallmap(void) {
if(map_readmap(i,fn, p) == -1) {
map_delmap(map[i].name);
maps_removed++;
+ } else {
+ if (last_time != time(0)) {
+ last_time = time(0);
+ switch(busy) {
+ case 0: c='\\'; busy++; break;
+ case 1: c='|'; busy++; break;
+ case 2: c='/'; busy++; break;
+ case 3: c='-'; busy=0;
+ }
+ }
+ printf("%c]",c);
+ fflush(stdout);
}
}
}
free(waterlist);
printf("\r");
- snprintf(tmp_output,sizeof(tmp_output),"Maps Loaded: \033[1;29m%d\033[0;0m %50s\n",map_num,"");
+ snprintf(tmp_output,sizeof(tmp_output),"Successfully loaded '"CL_WHITE"%d"CL_RESET"' maps.%50s\n",map_num,"");
ShowInfo(tmp_output);
if (maps_removed) {
- snprintf(tmp_output,sizeof(tmp_output),"Maps Removed: %d\n",maps_removed);
+ snprintf(tmp_output,sizeof(tmp_output),"Maps Removed: '"CL_WHITE"%d"CL_RESET"'\n",maps_removed);
ShowNotice(tmp_output);
}
return 0;
@@ -2386,13 +2414,13 @@ int do_init(int argc, char *argv[]) {
do_init_itemdb();
do_init_mob(); // npcの初期化時内でmob_spawnして、mob_dbを参照するのでinit_npcより先
do_init_script();
- do_init_npc();
do_init_pc();
do_init_party();
do_init_guild();
do_init_storage();
do_init_skill();
do_init_pet();
+ do_init_npc();
#ifndef TXT_ONLY /* mail system [Valaris] */
if(battle_config.mail_system)