Bug: /maxfps fg 0 = freeze/ctd

A forum for feature requests/discussions and user submitted patches that improve MQ2

Moderator: MacroQuest Developers

eq_freak
a ghoul
a ghoul
Posts: 105
Joined: Mon Jun 24, 2002 7:17 am

Bug: /maxfps fg 0 = freeze/ctd

Post by eq_freak » Tue Nov 11, 2003 11:13 am

Using a just downloaded IRC-latest.zip.

User avatar
Curious
a ghoul
a ghoul
Posts: 88
Joined: Wed Aug 27, 2003 5:19 am

Post by Curious » Tue Nov 11, 2003 11:40 am

lol - not really sure its a bug. 0 fps = freeze.

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 Nov 11, 2003 11:42 am

No, it's a bug. 0 is intended to work and be faster than if you tried /maxfps fg 200 ;)

It's a divide by zero error, uploading new zip soon but here's the fix:

EQLib_Commands.cpp

Code: Select all

// ***************************************************************************
// Function:      MaxFPS
// Description:   Our /MaxFPS command. Sets or displays the max fps setting for
//                foreground or background
// 2003-11-01     Lax
// ***************************************************************************
VOID MaxFPS(PSPAWNINFO pChar, PCHAR szLine)
{
   bRunNextCommand = TRUE;
   CHAR szCmd[MAX_STRING] = {0};
	CHAR Arg1[MAX_STRING] = {0};
	CHAR Arg2[MAX_STRING] = {0};
	GetArg(Arg1,szLine,1);
	GetArg(Arg2,szLine,2);


   if (Arg1[0]==0 || Arg2[0]==0) {
[color=red]	   sprintf(szCmd,"\aw\ayMaxFPS\ax\a-u:\ax \a-u[\ax\at%d\ax Foreground\a-u]\ax \a-u[\ax\at%d\ax Background\a-u]\ax",gFG_SLEEP?1000/gFG_SLEEP:0,gBG_SLEEP?1000/gBG_SLEEP:0);[/color]
		WriteChatBuffer(szCmd,USERCOLOR_DEFAULT);
		WriteChatBuffer("Usage: /maxfps <fg|bg> [#]",USERCOLOR_DEFAULT);
		return;
   }
   DWORD NewMax=atoi(Arg2);
   if (NewMax>200)
   {
	   WriteChatBuffer("MaxFPS: Please use a number between 0 and 200",USERCOLOR_DEFAULT);
	   return;
   }

   if (!stricmp(Arg1,"fg"))
   {
	 SetForegroundMaxFPS(NewMax);
	   WritePrivateProfileString("MacroQuest","ForegroundMaxFPS",Arg2,gszINIFilename);
   }
   else if (!stricmp(Arg1,"bg"))
   {
	   SetBackgroundMaxFPS(NewMax);
	   WritePrivateProfileString("MacroQuest","BackgroundMaxFPS",Arg2,gszINIFilename);
   }
[color=red]	   sprintf(szCmd,"\aw\ayMaxFPS\ax\a-u:\ax \a-u[\ax\at%d\ax Foreground\a-u]\ax \a-u[\ax\at%d\ax Background\a-u]\ax",gFG_SLEEP?1000/gFG_SLEEP:0,gBG_SLEEP?1000/gBG_SLEEP:0);[/color]
    WriteChatBuffer(szCmd,USERCOLOR_DEFAULT);
}
Lax Lacks
Master of MQ2 Disaster
Purveyor of premium, EULA-safe MMORPG Multiboxing Software
* Multiboxing with ISBoxer: Quick Start Video
* EQPlayNice, WinEQ 2.0

User avatar
Curious
a ghoul
a ghoul
Posts: 88
Joined: Wed Aug 27, 2003 5:19 am

Post by Curious » Tue Nov 11, 2003 11:47 am

Sweet! That's good news for me, thanks Lax :)

eq_freak
a ghoul
a ghoul
Posts: 105
Joined: Mon Jun 24, 2002 7:17 am

Post by eq_freak » Tue Nov 11, 2003 12:08 pm

Thanks :)

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 Nov 11, 2003 12:37 pm

Zip updated with this fixed.

Also, if you are having a problem with the FPS limiter please debug it for me. Turn on debug spew the usual way (EQLib_Utilities.cpp, macroquest.ini) and also uncomment the DBG_FPS line in EQLib.h. Then make sure if you're running EQW that in the debug spew, it says "EQW Detected". Also make sure that it says both "Foreground" and "Background" at some point in the log, and make sure when you are checking it in another window that it is in fact background ;)
Lax Lacks
Master of MQ2 Disaster
Purveyor of premium, EULA-safe MMORPG Multiboxing Software
* Multiboxing with ISBoxer: Quick Start Video
* EQPlayNice, WinEQ 2.0