|
@@ -29,7 +29,7 @@ int inter_pet_tosql(int pet_id, struct s_pet* p)
|
|
{// New pet.
|
|
{// New pet.
|
|
if( SQL_ERROR == Sql_Query(sql_handle, "INSERT INTO `%s` "
|
|
if( SQL_ERROR == Sql_Query(sql_handle, "INSERT INTO `%s` "
|
|
"(`class`,`name`,`account_id`,`char_id`,`level`,`egg_id`,`equip`,`intimate`,`hungry`,`rename_flag`,`incubate`) "
|
|
"(`class`,`name`,`account_id`,`char_id`,`level`,`egg_id`,`equip`,`intimate`,`hungry`,`rename_flag`,`incubate`) "
|
|
- "VALUES ('%d', '%s', '%d', '%d', '%d', '%d', '%d', '%d', '%d', '%d', '%d')",
|
|
|
|
|
|
+ "VALUES ('%d', '%s', '%d', '%d', '%d', '%hu', '%hu', '%d', '%d', '%d', '%d')",
|
|
schema_config.pet_db, p->class_, esc_name, p->account_id, p->char_id, p->level, p->egg_id,
|
|
schema_config.pet_db, p->class_, esc_name, p->account_id, p->char_id, p->level, p->egg_id,
|
|
p->equip, p->intimate, p->hungry, p->rename_flag, p->incubate) )
|
|
p->equip, p->intimate, p->hungry, p->rename_flag, p->incubate) )
|
|
{
|
|
{
|
|
@@ -40,7 +40,7 @@ int inter_pet_tosql(int pet_id, struct s_pet* p)
|
|
}
|
|
}
|
|
else
|
|
else
|
|
{// Update pet.
|
|
{// Update pet.
|
|
- if( SQL_ERROR == Sql_Query(sql_handle, "UPDATE `%s` SET `class`='%d',`name`='%s',`account_id`='%d',`char_id`='%d',`level`='%d',`egg_id`='%d',`equip`='%d',`intimate`='%d',`hungry`='%d',`rename_flag`='%d',`incubate`='%d' WHERE `pet_id`='%d'",
|
|
|
|
|
|
+ if( SQL_ERROR == Sql_Query(sql_handle, "UPDATE `%s` SET `class`='%d',`name`='%s',`account_id`='%d',`char_id`='%d',`level`='%d',`egg_id`='%hu',`equip`='%hu',`intimate`='%d',`hungry`='%d',`rename_flag`='%d',`incubate`='%d' WHERE `pet_id`='%d'",
|
|
schema_config.pet_db, p->class_, esc_name, p->account_id, p->char_id, p->level, p->egg_id,
|
|
schema_config.pet_db, p->class_, esc_name, p->account_id, p->char_id, p->level, p->egg_id,
|
|
p->equip, p->intimate, p->hungry, p->rename_flag, p->incubate, p->pet_id) )
|
|
p->equip, p->intimate, p->hungry, p->rename_flag, p->incubate, p->pet_id) )
|
|
{
|
|
{
|
|
@@ -178,8 +178,7 @@ int mapif_delete_pet_ack(int fd, int flag){
|
|
return 0;
|
|
return 0;
|
|
}
|
|
}
|
|
|
|
|
|
-int mapif_create_pet(int fd, uint32 account_id, uint32 char_id, short pet_class, short pet_lv, short pet_egg_id,
|
|
|
|
- short pet_equip, short intimate, short hungry, char rename_flag, char incubate, char *pet_name)
|
|
|
|
|
|
+int mapif_create_pet(int fd, uint32 account_id, uint32 char_id, short pet_class, short pet_lv, unsigned short pet_egg_id, unsigned short pet_equip, short intimate, short hungry, char rename_flag, char incubate, char *pet_name)
|
|
{
|
|
{
|
|
memset(pet_pt, 0, sizeof(struct s_pet));
|
|
memset(pet_pt, 0, sizeof(struct s_pet));
|
|
safestrncpy(pet_pt->name, pet_name, NAME_LENGTH);
|
|
safestrncpy(pet_pt->name, pet_name, NAME_LENGTH);
|