The patch below fixes a sprintf() format bug in SKILLS__GAIN log messages. The current code formats with %.4f but 'Chance' is actually an int32 so it gets skipped as an input parameter, causing the log message to put Chance in the (mod X) position and chancemodi to never be logged at all.
Code:
--- a/zone/client.cpp
+++ b/zone/client.cpp
@@ -2232,10 +2232,10 @@ bool Client::CheckIncreaseSkill(SkillUseTypes skillid, Mob *against_who, int cha
if(zone->random.Real(0, 99) < Chance)
{
SetSkill(skillid, GetRawSkill(skillid) + 1);
- _log(SKILLS__GAIN, "Skill %d at value %d successfully gain with %.4f%%chance (mod %d)", skillid, skillval, Chance, chancemodi);
+ _log(SKILLS__GAIN, "Skill %d at value %d successfully gain with %d%% chance (mod %d)", skillid, skillval, Chance, chancemodi);
return true;
} else {
- _log(SKILLS__GAIN, "Skill %d at value %d failed to gain with %.4f%%chance (mod %d)", skillid, skillval, Chance, chancemodi);
+ _log(SKILLS__GAIN, "Skill %d at value %d failed to gain with %d%% chance (mod %d)", skillid, skillval, Chance, chancemodi);
}
} else {
_log(SKILLS__GAIN, "Skill %d at value %d cannot increase due to maxmum %d", skillid, skillval, maxskill);