Support itemids up to ~2 billion (#5141)

Co-authored-by: aleos89 <aleos89@users.noreply.github.com>
Co-authored-by: Lemongrass3110 <lemongrass@kstp.at>
This commit is contained in:
Vincent Stumpf
2020-08-08 03:06:07 -07:00
committed by GitHub
parent fd148a6783
commit 3776bfbaa3
71 changed files with 1012 additions and 777 deletions

View File

@@ -448,9 +448,9 @@ uint64 PetDatabase::parseBodyNode( const YAML::Node &node ){
return 0;
}
uint32 amount;
uint16 amount;
if( !this->asUInt32( requirementNode, "Amount", amount ) ){
if( !this->asUInt16( requirementNode, "Amount", amount ) ){
return 0;
}
@@ -659,7 +659,7 @@ void pet_set_intimate(struct pet_data *pd, int value)
* @param item_id : item ID of tamer
* @return true:success, false:failure
*/
bool pet_create_egg(struct map_session_data *sd, unsigned short item_id)
bool pet_create_egg(struct map_session_data *sd, t_itemid item_id)
{
std::shared_ptr<s_pet_db> pet = pet_db_search(item_id, PET_EGG);
@@ -1242,7 +1242,8 @@ int pet_catch_process2(struct map_session_data* sd, int target_id)
if(!md || md->bl.type != BL_MOB || md->bl.prev == NULL) { // Invalid inputs/state, abort capture.
clif_pet_roulette(sd,0);
sd->catch_target_class = PET_CATCH_FAIL;
sd->itemid = sd->itemindex = -1;
sd->itemid = 0;
sd->itemindex = -1;
return 1;
}
@@ -1460,7 +1461,6 @@ int pet_change_name_ack(struct map_session_data *sd, char* name, int flag)
int pet_equipitem(struct map_session_data *sd,int index)
{
struct pet_data *pd;
unsigned short nameid;
nullpo_retr(1, sd);
@@ -1475,7 +1475,7 @@ int pet_equipitem(struct map_session_data *sd,int index)
return 1;
}
nameid = sd->inventory.u.items_inventory[index].nameid;
t_itemid nameid = sd->inventory.u.items_inventory[index].nameid;
if(pet_db_ptr->AcceID == 0 || nameid != pet_db_ptr->AcceID || pd->pet.equip != 0) {
clif_equipitemack(sd,0,0,ITEM_EQUIP_ACK_FAIL);
@@ -1513,13 +1513,12 @@ int pet_equipitem(struct map_session_data *sd,int index)
static int pet_unequipitem(struct map_session_data *sd, struct pet_data *pd)
{
struct item tmp_item;
unsigned short nameid;
unsigned char flag = 0;
if(pd->pet.equip == 0)
return 1;
nameid = pd->pet.equip;
t_itemid nameid = pd->pet.equip;
pd->pet.equip = 0;
status_set_viewdata(&pd->bl, pd->pet.class_);
clif_pet_equip_area(pd);