Home » PLAYER'S HQ 1.13 » JA2 Complete Mods & Sequels » Stracciatella Project (Platform Independent JA2) » [Debug Fix] Print format of GetJA2Clock()
[Debug Fix] Print format of GetJA2Clock()[message #263125] Mon, 20 September 2010 23:35 Go to next message
mgl is currently offline mgl

 
Messages:255
Registered:December 2007
Location: France
No user should need this fix, it's probably for subversion only.

GetJA2Clock() returns an unsigned value but several debug functions print it as a signed one.
In my game, the value became big enough to be displayed as a negative number.
This patch fixes the calls I have noticed.

Index: Build/TacticalAI/AIMain.cc
===================================================================
--- Build/TacticalAI/AIMain.cc    (revision 7072)
+++ Build/TacticalAI/AIMain.cc    (working copy)
@@ -1459,7 +1470,7 @@
     }
     #endif
 
-    DebugAI(String("%d does %hs (a.d. %d) at time %ld", pSoldier->ubID, gzActionStr[pSoldier->bAction], pSoldier->usActionData, GetJA2Clock()));
+    DebugAI(String("%d does %hs (a.d. %d) at time %lu", pSoldier->ubID, gzActionStr[pSoldier->bAction], pSoldier->usActionData, GetJA2Clock()));
 
     switch (pSoldier->bAction)
     {
Index: Build/TacticalAI/NPC.cc
===================================================================
--- Build/TacticalAI/NPC.cc    (revision 7072)
+++ Build/TacticalAI/NPC.cc    (working copy)
@@ -1617,7 +1626,7 @@
                     break;
                 case TRIGGER_NPC:
                     // if triggering, pass in the approach data as the record to consider
-                    DebugMsg(TOPIC_JA2, DBG_LEVEL_0, String("Handling trigger %ls/%d at %ld", gMercProfiles[ubNPC].zNickname, approach_record, GetJA2Clock()));
+                    DebugMsg(TOPIC_JA2, DBG_LEVEL_0, String("Handling trigger %ls/%d at %lu", gMercProfiles[ubNPC].zNickname, approach_record, GetJA2Clock()));
                     NPCConsiderTalking(ubNPC, ubMerc, bApproach, approach_record, pNPCQuoteInfoArray, &pQuotePtr, &ubRecordNum);
                     break;
                 default:

Report message to a moderator

Master Sergeant
Re: [Debug Fix] Print format of GetJA2Clock()[message #263243] Wed, 22 September 2010 11:29 Go to previous message
wanne (aka RoWa21) is currently offline wanne (aka RoWa21)

 
Messages:1961
Registered:October 2005
Location: Austria
Thanks, patch is also applied to 1.13

Report message to a moderator

Sergeant Major

Previous Topic: Add some variation until we can mod stracciatella
Next Topic: File Naming Convention on Linux (and crashes)
Goto Forum:
  


Current Time: Wed May 01 16:26:08 GMT+3 2024

Total time taken to generate the page: 0.01027 seconds