浏览代码

* Removed 'negative clrtype is used for skipping unauthed objects from saving' introduced in r9975, as it is no longer required/used (follow up to r12223).

git-svn-id: https://svn.code.sf.net/p/rathena/svn/trunk@14515 54d463be-8e91-2dee-dedb-b68131a5f0ec
ai4rei 14 年之前
父节点
当前提交
7a092c2aca
共有 2 个文件被更改,包括 20 次插入30 次删除
  1. 1 0
      Changelog-Trunk.txt
  2. 19 30
      src/map/unit.c

+ 1 - 0
Changelog-Trunk.txt

@@ -1,6 +1,7 @@
 Date	Added
 
 2010/11/28
+	* Removed 'negative clrtype is used for skipping unauthed objects from saving' introduced in r9975, as it is no longer required/used (follow up to r12223). [Ai4rei]
 	* Made the party booking search pass results as array of pointers, rather than array of indexes, which require further lookup. [Ai4rei]
 	* Replaced literal constants related to the party booking system with defines. [Ai4rei]
 	* Fixed pets derived from immobile monsters not being able to walk (bugreport:3377, since r13789). [Ai4rei]

+ 19 - 30
src/map/unit.c

@@ -650,7 +650,7 @@ int unit_warp(struct block_list *bl,short m,short x,short y,int type)
 	if(bl->prev==NULL || !ud)
 		return 1;
 
-	if (type < 0 || type == 1)
+	if (type == 1)
 		//Type 1 is invalid, since you shouldn't warp a bl with the "death" 
 		//animation, it messes up with unit_remove_map! [Skotlex]
 		return 1;
@@ -2030,8 +2030,6 @@ void unit_free_pc(struct map_session_data *sd)
 /*==========================================
  * Function to free all related resources to the bl
  * if unit is on map, it is removed using the clrtype specified
- * If clrtype is <0, no saving is performed. This is only for non-authed
- * objects that shouldn't be on a map yet.
  *------------------------------------------*/
 int unit_free(struct block_list *bl, int clrtype)
 {
@@ -2138,15 +2136,12 @@ int unit_free(struct block_list *bl, int clrtype)
 				aFree (pd->loot);
 				pd->loot = NULL;
 			}
-			if( clrtype >= 0 )
-			{
-				if( pd->pet.intimate > 0 )
-					intif_save_petdata(pd->pet.account_id,&pd->pet);
-				else
-				{	//Remove pet.
-					intif_delete_petdata(pd->pet.pet_id);
-					if (sd) sd->status.pet_id = 0;
-				}
+			if( pd->pet.intimate > 0 )
+				intif_save_petdata(pd->pet.account_id,&pd->pet);
+			else
+			{	//Remove pet.
+				intif_delete_petdata(pd->pet.pet_id);
+				if (sd) sd->status.pet_id = 0;
 			}
 			if( sd )
 				sd->pd = NULL;
@@ -2213,16 +2208,13 @@ int unit_free(struct block_list *bl, int clrtype)
 			struct homun_data *hd = (TBL_HOM*)bl;
 			struct map_session_data *sd = hd->master;
 			merc_hom_hungry_timer_delete(hd);
-			if( clrtype >= 0 )
+			if( hd->homunculus.intimacy > 0 )
+				merc_save(hd);
+			else
 			{
-				if( hd->homunculus.intimacy > 0 )
-					merc_save(hd);
-				else
-				{
-					intif_homunculus_requestdelete(hd->homunculus.hom_id);
-					if( sd )
-						sd->status.hom_id = 0;
-				}
+				intif_homunculus_requestdelete(hd->homunculus.hom_id);
+				if( sd )
+					sd->status.hom_id = 0;
 			}
 			if( sd )
 				sd->hd = NULL;
@@ -2232,16 +2224,13 @@ int unit_free(struct block_list *bl, int clrtype)
 		{
 			struct mercenary_data *md = (TBL_MER*)bl;
 			struct map_session_data *sd = md->master;
-			if( clrtype >= 0 )
+			if( mercenary_get_lifetime(md) > 0 )
+				mercenary_save(md);
+			else
 			{
-				if( mercenary_get_lifetime(md) > 0 )
-					mercenary_save(md);
-				else
-				{
-					intif_mercenary_delete(md->mercenary.mercenary_id);
-					if( sd )
-						sd->status.mer_id = 0;
-				}
+				intif_mercenary_delete(md->mercenary.mercenary_id);
+				if( sd )
+					sd->status.mer_id = 0;
 			}
 			if( sd )
 				sd->md = NULL;