Fixes cooking value not updating properly (#6605)

* Fixes #6602.
* Resolves cooking items only updating the player's cooking variable and not properly updating the player's session data along with it.
Thanks to @Shaktohh and @Lemongrass3110!
This commit is contained in:
Aleos 2022-02-08 15:04:53 -05:00 committed by GitHub
parent 645ff8591a
commit 4b1446bd09
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 2 additions and 6 deletions

View File

@ -9867,8 +9867,6 @@ bool pc_setparam(struct map_session_data *sd,int64 type,int64 val_tmp)
pc_setglobalreg(sd, add_str(PCDIECOUNTER_VAR), sd->die_counter);
return true;
case SP_COOKMASTERY:
if (val < 0)
return false;
if (sd->cook_mastery == val)
return true;
val = cap_value(val, 0, 1999);

View File

@ -21832,8 +21832,7 @@ bool skill_produce_mix(struct map_session_data *sd, uint16 skill_id, t_itemid na
default: //Those that don't require a skill?
if (skill_produce_db[idx].itemlv > 10 && skill_produce_db[idx].itemlv <= 20) { //Cooking items.
clif_specialeffect(&sd->bl, EF_COOKING_OK, AREA);
if (sd->cook_mastery < 1999)
pc_setglobalreg(sd, add_str(COOKMASTERY_VAR), sd->cook_mastery + ( 1 << ( (skill_produce_db[idx].itemlv - 11) / 2 ) ) * 5);
pc_setparam(sd, SP_COOKMASTERY, sd->cook_mastery + ( 1 << ( (skill_produce_db[idx].itemlv - 11) / 2 ) ) * 5);
}
break;
}
@ -21987,8 +21986,7 @@ bool skill_produce_mix(struct map_session_data *sd, uint16 skill_id, t_itemid na
default:
if (skill_produce_db[idx].itemlv > 10 && skill_produce_db[idx].itemlv <= 20 ) { //Cooking items.
clif_specialeffect(&sd->bl, EF_COOKING_FAIL, AREA);
if (sd->cook_mastery > 0)
pc_setglobalreg(sd, add_str(COOKMASTERY_VAR), sd->cook_mastery - ( 1 << ((skill_produce_db[idx].itemlv - 11) / 2) ) - ( ( ( 1 << ((skill_produce_db[idx].itemlv - 11) / 2) ) >> 1 ) * 3 ));
pc_setparam(sd, SP_COOKMASTERY, sd->cook_mastery - ( 1 << ((skill_produce_db[idx].itemlv - 11) / 2) ) - ( ( ( 1 << ((skill_produce_db[idx].itemlv - 11) / 2) ) >> 1 ) * 3 ));
}
break;
}