Przeglądaj źródła

Increased MAX_STATUCHANGE to 300 so we won't get the same error over and over next time we add an SC...
Reverted the map index reading for the map-server to the old system (from map_list.txt and not map_cache.dat)

git-svn-id: https://svn.code.sf.net/p/rathena/svn/trunk@10034 54d463be-8e91-2dee-dedb-b68131a5f0ec

DracoRPG 18 lat temu
rodzic
commit
e63626deea
3 zmienionych plików z 12 dodań i 7 usunięć
  1. 3 1
      Changelog-Trunk.txt
  2. 8 5
      src/map/map.c
  3. 1 1
      src/map/map.h

+ 3 - 1
Changelog-Trunk.txt

@@ -4,7 +4,9 @@ AS OF SVN REV. 5091, WE ARE NOW USING TRUNK.  ALL UNTESTED BUGFIXES/FEATURES GO
 IF YOU HAVE A WORKING AND TESTED BUGFIX PUT IT INTO STABLE AS WELL AS TRUNK.
 
 2007/03/20
-	* Patched the MAX_STATUSCHANGE startup error [ultramage]
+	* Increased MAX_STATUSCHANGE to 300 to make room for new statuses [DracoRPG]
+	* Reverted mapindex reading from map_list.txt for the map-server [DracoRPG]
+	* Patched the MAX_STATUSCHANGE startup error [ultramage
 	* Removed the last argument from script command skillitem.
 	* Added skill ITEM_ENCHANTARMS, this is what weapon enchanting items should
 	  use.

+ 8 - 5
src/map/map.c

@@ -2454,7 +2454,6 @@ int map_readmap(struct map_data *m)
 	for(i = 0; i < map_count; i++) {
 		fread(&info, sizeof(info), 1, map_cache_fp);
 		if(strcmp(m->name, info.name) == 0) { // Map found
-			m->index = info.index;
 			m->xs = info.xs;
 			m->ys = info.ys;
 			m->gat = (unsigned char *)aMalloc(m->xs*m->ys); // Allocate room for map cells data
@@ -2567,6 +2566,8 @@ int map_readallmaps (void)
 			continue;
 		}
 
+		map[i].index = mapindex_name2id(map[i].name);
+
 		if (uidb_get(map_db,(unsigned int)map[i].index) != NULL) {
 			ShowWarning("Map %s already loaded!\n", map[i].name);
 			if (map[i].gat) {
@@ -2579,6 +2580,8 @@ int map_readallmaps (void)
 			continue;
 		}
 
+		uidb_put(map_db, (unsigned int)map[i].index, &map[i]);
+
 		map[i].m = i;
 		memset(map[i].moblist, 0, sizeof(map[i].moblist));	//Initialize moblist [Skotlex]
 		map[i].mob_delete_timer = -1;	//Initialize timer [Skotlex]
@@ -2604,9 +2607,6 @@ int map_readallmaps (void)
 		size = map[i].bxs * map[i].bys * sizeof(int);
 		map[i].block_count = (int*)aCallocA(size, 1);
 		map[i].block_mob_count = (int*)aCallocA(size, 1);
-
-		mapindex_addmap(map[i].index, map[i].name);
-		uidb_put(map_db, (unsigned int)map[i].index, &map[i]);
 	}
 
 	// finished map loading
@@ -3142,7 +3142,9 @@ void do_final(void) {
 				if (map[i].moblist[j]) aFree(map[i].moblist[j]);
 		}
 	}
-	
+
+	mapindex_final();
+
 	id_db->destroy(id_db, NULL);
 	pc_db->destroy(pc_db, NULL);
 	charid_db->destroy(charid_db, NULL);
@@ -3296,6 +3298,7 @@ int do_init(int argc, char *argv[]) {
 	map_sql_init();
 #endif /* not TXT_ONLY */
 
+	mapindex_init();
 	map_readallmaps();
 
 	add_timer_func_list(map_freeblock_timer, "map_freeblock_timer");

+ 1 - 1
src/map/map.h

@@ -31,7 +31,7 @@
 #define LIFETIME_FLOORITEM 60
 #define DAMAGELOG_SIZE 30
 #define LOOTITEM_SIZE 10
-#define MAX_STATUSCHANGE 251
+#define MAX_STATUSCHANGE 300
 //Quick defines to know which are the min-max common ailments. [Skotlex]
 //Because of the way the headers are included.. these must be replaced for actual values.
 //Remember to update as needed! Min is SC_STONE and max is SC_DPOISON currently.