Go Back   EQEmulator Home > EQEmulator Forums > Development > Development::Server Code Submissions

Reply
 
Thread Tools Display Modes
  #1  
Old 01-20-2015, 02:24 PM
iluvseq
Sarnak
 
Join Date: Aug 2009
Location: Somewhere
Posts: 53
Default COMMITTED: Sprintf bug in SKILLS__GAIN log message

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);

Last edited by joligario; 01-20-2015 at 04:32 PM..
Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

   

All times are GMT -4. The time now is 02:54 AM.


 

Everquest is a registered trademark of Daybreak Game Company LLC.
EQEmulator is not associated or affiliated in any way with Daybreak Game Company LLC.
Except where otherwise noted, this site is licensed under a Creative Commons License.
       
Powered by vBulletin®, Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Template by Bluepearl Design and vBulletin Templates - Ver3.3