Added 2 new parameters for getpetinfo (#3164)
Fixed inter-server handling for creation of pets that are not incubated. Thanks to @Everade for his idea.
This commit is contained in:
parent
151c8476af
commit
dd60f4c47e
@ -9243,6 +9243,8 @@ currently has active. Valid types are:
|
||||
PETINFO_RENAMED - Pet rename flag. 0 means this pet has not been named yet.
|
||||
PETINFO_LEVEL - Pet level
|
||||
PETINFO_BLOCKID - Pet Game ID
|
||||
PETINFO_EGGID - Pet egg item id
|
||||
PETINFO_FOODID - Pet food item id
|
||||
|
||||
---------------------------------------
|
||||
|
||||
|
@ -18,6 +18,7 @@
|
||||
#include "inter.hpp"
|
||||
|
||||
struct s_pet *pet_pt;
|
||||
int mapif_load_pet(int fd, uint32 account_id, uint32 char_id, int pet_id);
|
||||
|
||||
//---------------------------------------------------------
|
||||
int inter_pet_tosql(int pet_id, struct s_pet* p)
|
||||
@ -211,9 +212,13 @@ int mapif_create_pet(int fd, uint32 account_id, uint32 char_id, short pet_class,
|
||||
pet_pt->intimate = 1000;
|
||||
|
||||
pet_pt->pet_id = -1; //Signal NEW pet.
|
||||
if (inter_pet_tosql(pet_pt->pet_id,pet_pt))
|
||||
mapif_pet_created(fd, account_id, pet_pt);
|
||||
else //Failed...
|
||||
if (inter_pet_tosql(pet_pt->pet_id,pet_pt)){
|
||||
if( pet_pt->incubate ){
|
||||
mapif_pet_created(fd, account_id, pet_pt);
|
||||
}else{
|
||||
mapif_load_pet(fd, account_id, char_id, pet_pt->pet_id);
|
||||
}
|
||||
}else //Failed...
|
||||
mapif_pet_created(fd, account_id, NULL);
|
||||
|
||||
return 0;
|
||||
|
@ -14916,6 +14916,8 @@ BUILDIN_FUNC(getpetinfo)
|
||||
case PETINFO_RENAMED: script_pushint(st,pd->pet.rename_flag); break;
|
||||
case PETINFO_LEVEL: script_pushint(st,(int)pd->pet.level); break;
|
||||
case PETINFO_BLOCKID: script_pushint(st,pd->bl.id); break;
|
||||
case PETINFO_EGGID: script_pushint(st,pd->pet.egg_id); break;
|
||||
case PETINFO_FOODID: script_pushint(st,pd->get_pet_db()->FoodID); break;
|
||||
default:
|
||||
script_pushint(st,0);
|
||||
break;
|
||||
|
@ -378,7 +378,9 @@ enum petinfo_types {
|
||||
PETINFO_HUNGRY,
|
||||
PETINFO_RENAMED,
|
||||
PETINFO_LEVEL,
|
||||
PETINFO_BLOCKID
|
||||
PETINFO_BLOCKID,
|
||||
PETINFO_EGGID,
|
||||
PETINFO_FOODID
|
||||
};
|
||||
|
||||
enum questinfo_types {
|
||||
|
@ -3922,6 +3922,8 @@
|
||||
export_constant(PETINFO_RENAMED);
|
||||
export_constant(PETINFO_LEVEL);
|
||||
export_constant(PETINFO_BLOCKID);
|
||||
export_constant(PETINFO_EGGID);
|
||||
export_constant(PETINFO_FOODID);
|
||||
|
||||
// For backwards compatability - might be removed in the near future
|
||||
export_constant2("PET_ID",PETINFO_ID);
|
||||
@ -4334,6 +4336,7 @@
|
||||
export_constant(ROA_VALUE);
|
||||
export_constant(ROA_PARAM);
|
||||
|
||||
/* special card flags */
|
||||
export_constant(CARD0_FORGE);
|
||||
export_constant(CARD0_CREATE);
|
||||
export_constant(CARD0_PET);
|
||||
|
Loading…
x
Reference in New Issue
Block a user