浏览代码

- Some minor cleanups
- Fixed the Homunc not spawning next to you after receiving it's data from the char-server.


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

skotlex 18 年之前
父节点
当前提交
a127683c6b
共有 4 个文件被更改,包括 23 次插入26 次删除
  1. 2 0
      Changelog-Trunk.txt
  2. 1 1
      db/skill_db.txt
  3. 1 2
      src/char_sql/char.c
  4. 19 23
      src/map/mercenary.c

+ 2 - 0
Changelog-Trunk.txt

@@ -4,6 +4,8 @@ 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.
 IF YOU HAVE A WORKING AND TESTED BUGFIX PUT IT INTO STABLE AS WELL AS TRUNK.
 
 
 2006/10/20
 2006/10/20
+	* Fixed the Homunc not spawning next to you after receiving it's data from
+	  the char-server. [Skotlex]
 	* Fixed Charge Atk being able to go through chasm/pits. [Skotlex]
 	* Fixed Charge Atk being able to go through chasm/pits. [Skotlex]
 	* Moved the homunculus DB information from the player structure to the
 	* Moved the homunculus DB information from the player structure to the
 	  homun structure. Modified the homunculus creation packets to hold this
 	  homun structure. Modified the homunculus creation packets to hold this

+ 1 - 1
db/skill_db.txt

@@ -182,7 +182,7 @@
 156,9,6,1,6,0,0,1,1,yes,0,1,0,magic,0	//AL_HOLYLIGHT#Holy Light#
 156,9,6,1,6,0,0,1,1,yes,0,1,0,magic,0	//AL_HOLYLIGHT#Holy Light#
 157,0,6,4,0,1,0,1,1,yes,0,1,0,magic,0	//MG_ENERGYCOAT#Energy Coat#
 157,0,6,4,0,1,0,1,1,yes,0,1,0,magic,0	//MG_ENERGYCOAT#Energy Coat#
 158,3,6,1,-1,0,0,10,1,no,0,2,0,weapon,0	//NPC_PIERCINGATT#Thrusting attack#
 158,3,6,1,-1,0,0,10,1,no,0,2,0,weapon,0	//NPC_PIERCINGATT#Thrusting attack#
-159,-1,6,1,-1,0,0,10,1,no,0,2,0,weapon,0	//NPC_MENTALBREAKER#Spirit Destruction#
+159,-1,6,1,-1,0,0,5,1,no,0,2,0,weapon,0	//NPC_MENTALBREAKER#Spirit Destruction#
 160,9,6,1,0,0,0,10,1,no,0,2,0,weapon,0	//NPC_RANGEATTACK#Stand off attack#
 160,9,6,1,0,0,0,10,1,no,0,2,0,weapon,0	//NPC_RANGEATTACK#Stand off attack#
 161,0,0,4,0,1,0,1,1,no,0,2,0,magic,0	//NPC_ATTRICHANGE#Run Attribute Change#
 161,0,0,4,0,1,0,1,1,no,0,2,0,magic,0	//NPC_ATTRICHANGE#Run Attribute Change#
 162,0,0,4,1,1,0,1,1,no,0,2,0,magic,0	//NPC_CHANGEWATER#Water Attribute Change#
 162,0,0,4,1,1,0,1,1,no,0,2,0,magic,0	//NPC_CHANGEWATER#Water Attribute Change#

+ 1 - 2
src/char_sql/char.c

@@ -3942,7 +3942,6 @@ void sql_config_read(const char *cfgName){ /* Kalaspuff, to get login_db */
 		}else if(strcmpi(w1,"lowest_gm_level")==0){
 		}else if(strcmpi(w1,"lowest_gm_level")==0){
 			lowest_gm_level = atoi(w2);
 			lowest_gm_level = atoi(w2);
 			ShowStatus("set lowest_gm_level : %s\n",w2);
 			ShowStatus("set lowest_gm_level : %s\n",w2);
-		//support the import command, just like any other config
 #endif
 #endif
 		}else if(strcmpi(w1,"scdata_db")==0){
 		}else if(strcmpi(w1,"scdata_db")==0){
 			strcpy(scdata_db,w2);
 			strcpy(scdata_db,w2);
@@ -3997,8 +3996,8 @@ void sql_config_read(const char *cfgName){ /* Kalaspuff, to get login_db */
 			strcpy(item_db2_db,w2);
 			strcpy(item_db2_db,w2);
 		} else if(strcmpi(w1,"connection_ping_interval")==0) {
 		} else if(strcmpi(w1,"connection_ping_interval")==0) {
 			connection_ping_interval = config_switch(w2);
 			connection_ping_interval = config_switch(w2);
-
 #endif
 #endif
+		//support the import command, just like any other config
 		}else if(strcmpi(w1,"import")==0){
 		}else if(strcmpi(w1,"import")==0){
 			sql_config_read(w2);
 			sql_config_read(w2);
 		}
 		}

+ 19 - 23
src/map/mercenary.c

@@ -537,9 +537,19 @@ int merc_hom_alloc(struct map_session_data *sd, struct s_homunculus *hom)
 		return 1;
 		return 1;
 	}
 	}
 	sd->hd = hd = aCalloc(1,sizeof(struct homun_data));
 	sd->hd = hd = aCalloc(1,sizeof(struct homun_data));
+	hd->bl.subtype = MONS;
+	hd->bl.type = BL_HOM;
+	hd->bl.id = npc_get_new_npc_id();
+
+	hd->master = sd;
 	hd->homunculusDB = &homunculus_db[i];
 	hd->homunculusDB = &homunculus_db[i];
 	memcpy(&hd->homunculus, hom, sizeof(struct s_homunculus));
 	memcpy(&hd->homunculus, hom, sizeof(struct s_homunculus));
-	hd->master = sd;
+	hd->exp_next = hexptbl[hd->homunculus.level - 1];
+
+	status_set_viewdata(&hd->bl, hd->homunculus.class_);
+	status_change_init(&hd->bl);
+	unit_dataset(&hd->bl);
+	hd->ud.dir = sd->ud.dir;
 
 
 	// Find a random valid pos around the player
 	// Find a random valid pos around the player
 	hd->bl.m = sd->bl.m;
 	hd->bl.m = sd->bl.m;
@@ -550,18 +560,6 @@ int merc_hom_alloc(struct map_session_data *sd, struct s_homunculus *hom)
 	map_random_dir(&hd->bl, &x, &y);
 	map_random_dir(&hd->bl, &x, &y);
 	hd->bl.x = x;
 	hd->bl.x = x;
 	hd->bl.y = y;
 	hd->bl.y = y;
-
-	hd->bl.subtype = MONS;
-	hd->bl.type = BL_HOM;
-	hd->bl.id = npc_get_new_npc_id();
-	hd->bl.prev = NULL;
-	hd->bl.next = NULL;
-	hd->exp_next = hexptbl[hd->homunculus.level - 1];
-
-	status_set_viewdata(&hd->bl, hd->homunculus.class_);
-	status_change_init(&hd->bl);
-	unit_dataset(&hd->bl);
-	hd->ud.dir = sd->ud.dir;
 	
 	
 	map_addiddb(&hd->bl);
 	map_addiddb(&hd->bl);
 	status_calc_homunculus(hd,1);
 	status_calc_homunculus(hd,1);
@@ -644,17 +642,15 @@ int merc_hom_recv_data(int account_id, struct s_homunculus *sh, int flag)
 		merc_hom_alloc(sd, sh);
 		merc_hom_alloc(sd, sh);
 	
 	
 	hd = sd->hd;
 	hd = sd->hd;
-	if(hd->homunculus.hp && !hd->homunculus.vaporize)
+	if(hd->homunculus.hp && !hd->homunculus.vaporize && hd->bl.prev == NULL)
 	{
 	{
-		if (hd->bl.prev != NULL) {
-			map_addblock(&hd->bl);
-			clif_spawn(&hd->bl);
-			clif_hominfo(sd,hd,1);
-			clif_hominfo(sd,hd,0); // send this x2. dunno why, but kRO does that [blackhole89]
-			clif_homskillinfoblock(sd);
-			clif_hominfo(sd,hd,0);
-			clif_send_homdata(sd,SP_ACK,0);
-		}
+		map_addblock(&hd->bl);
+		clif_spawn(&hd->bl);
+		clif_hominfo(sd,hd,1);
+		clif_hominfo(sd,hd,0); // send this x2. dunno why, but kRO does that [blackhole89]
+		clif_homskillinfoblock(sd);
+		clif_hominfo(sd,hd,0);
+		clif_send_homdata(sd,SP_ACK,0);
 	}
 	}
 	return 1;
 	return 1;
 }
 }