Pārlūkot izejas kodu

- Pet eggs won't be deleted upon selection for hatching, but on pet data retrieval now.
- Added check to pc_readdb to printout if a certain job is missing it's experience table.
- Added Job_Wedding to db/const.txt


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

skotlex 19 gadi atpakaļ
vecāks
revīzija
e647a2cbe3
4 mainītis faili ar 31 papildinājumiem un 5 dzēšanām
  1. 4 0
      Changelog-Trunk.txt
  2. 1 0
      db/const.txt
  3. 9 0
      src/map/pc.c
  4. 17 5
      src/map/pet.c

+ 4 - 0
Changelog-Trunk.txt

@@ -5,6 +5,10 @@ IF YOU HAVE A WORKING AND TESTED BUGFIX PUT IT INTO STABLE AS WELL AS TRUNK.  EV
 GOES INTO TRUNK AND WILL BE MERGED INTO STABLE BY VALARIS AND WIZPUTER. -- VALARIS
 
 2006/02/13
+	* Pet eggs will now not be deleted from the inventory until they arrive
+	  from the char-server. [Skotlex]
+	* pc_readdb will now print if any classes are missing their exp tables.
+	  Only exception are JOB_WEDDING and JOB_XMAS. [Skotlex]
 	* Made the NPC_BREAK* skills attack skills again, their chance of equipment
 	  breaking code was moved to skill_additional_effect. [Skotlex]
 	* Now when the exp table does not has enough data to reach the max level

+ 1 - 0
db/const.txt

@@ -20,6 +20,7 @@ Job_Alchem	18
 Job_Bard	19
 Job_Dancer	20
 Job_Crusader2	21
+Job_Wedding	22
 Job_SuperNovice	23
 Job_Gunslinger	24
 Job_Ninja	25

+ 9 - 0
src/map/pc.c

@@ -8164,6 +8164,15 @@ int pc_readdb(void)
 		}
 	}
 	fclose(fp);
+	for (i = 0; i < MAX_PC_CLASS; i++) {
+		if (!pcdb_checkid(i)) continue;
+		if (i == JOB_WEDDING || i == JOB_XMAS)
+			continue; //Classes that do not need exp tables.
+		if (!max_level[i][0])
+			ShowWarning("Class %s (%d) does not has a base exp table.\n", job_name(i), i);
+		if (!max_level[i][1])
+			ShowWarning("Class %s (%d) does not has a job exp table.\n", job_name(i), i);
+	}
 	ShowStatus("Done reading '"CL_WHITE"%s"CL_RESET"'.\n","exp.txt");
 
 	// ƒXƒLƒ‹ƒcƒŠ?

+ 17 - 5
src/map/pet.c

@@ -1032,9 +1032,23 @@ int pet_recv_petdata(int account_id,struct s_pet *p,int flag)
 		return 1;
 	}
 	memcpy(&sd->pet,p,sizeof(struct s_pet));
-	if(sd->pet.incuvate == 1)
-		pet_birth_process(sd);
-	else {
+	if(sd->pet.incuvate == 1) {
+		if (!pet_birth_process(sd))
+	  	{
+			int i;
+			//Delete egg from inventory. [Skotlex]
+			for (i = 0; i < MAX_INVENTORY; i++) {
+				if(sd->status.inventory[i].card[0] == (short)0xff00 &&
+					p->pet_id == MakeDWord(sd->status.inventory[i].card[1], sd->status.inventory[i].card[2]))
+			  	{
+					pc_delitem(sd,i,1,0);
+					break;
+				}
+			}
+			if(i >= MAX_INVENTORY && battle_config.error_log)
+				ShowError("pet_recv_petdata: Hatched pet (%d:%s), but couldn't find egg in inventory for removal!\n",p->pet_id, p->name);
+		}
+	} else {
 		pet_data_init(sd);
 		if(sd->pd && sd->bl.prev != NULL) {
 			map_addblock(&sd->pd->bl);
@@ -1065,8 +1079,6 @@ int pet_select_egg(struct map_session_data *sd,short egg_index)
 		if(battle_config.error_log)
 			ShowError("wrong egg item inventory %d\n",egg_index);
 	}
-	pc_delitem(sd,egg_index,1,0);
-
 	return 0;
 }