tick.Time

A forum for reporting bugs NOT related to custom plugins.

Moderator: MacroQuest Developers

dok
a ghoul
a ghoul
Posts: 127
Joined: Mon Mar 15, 2004 3:38 pm

tick.Time

Post by dok » Mon May 03, 2004 10:16 pm

tick.Time isn't showing up correctly. Here is code to get it working as described in changes.txt.

About line 434 in MQ2DataTypes.h

Changes I made are in red.

Swapped the Hours and Minute Calculations.
Removed the preceding 0 in minutes if Hours = 0 and Mins <= 9

Edit: readded the Secs=Secs% code

Code: Select all

		case Time:
			{
				int Secs=nTicks*6;
				[color=red]int Hrs=(Secs/3600);
				Secs=Secs%3600;
				int Mins=Secs/60;[/color]
				Secs=Secs%60;

				if (Hrs)
					sprintf(DataTypeTemp,"%d:%02d:%02d",Hrs,Mins,Secs);
				else
					sprintf(DataTypeTemp,"[color=red]%d[/color]:%02d",Mins,Secs);
				Dest.Ptr=&DataTypeTemp[0];
				Dest.Type=pStringType;
			}
			return true;
Last edited by dok on Tue May 04, 2004 1:33 am, edited 2 times in total.

MacroFiend
a grimling bloodguard
a grimling bloodguard
Posts: 662
Joined: Mon Jul 28, 2003 2:47 am

Post by MacroFiend » Mon May 03, 2004 10:39 pm

A % in a math calculation means to do modulo division which is to return the remainder of x divided by y.

Zeus
a hill giant
a hill giant
Posts: 180
Joined: Wed Feb 19, 2003 10:03 am
Contact:

Post by Zeus » Mon May 03, 2004 11:57 pm

Umm heard of operator -= ? :)

Lax
We're not worthy!
We're not worthy!
Posts: 3524
Joined: Thu Oct 17, 2002 1:01 pm
Location: ISBoxer
Contact:

Post by Lax » Tue May 04, 2004 10:32 am

The problem was actually an extraneous Secs=Secs%60; before setting Hrs=

fixed next zip.
Lax Lacks
Master of MQ2 Disaster
Purveyor of premium, EULA-safe MMORPG Multiboxing Software
* Multiboxing with ISBoxer: Quick Start Video
* EQPlayNice, WinEQ 2.0