/alert problem - help!

A forum for the general posts relating to MacroQuest. *DEPRECATED: This forum is no longer in public use, but remains here for your reading pleasure. Enjoy

Moderator: MacroQuest Developers

funmonkey
orc pawn
orc pawn
Posts: 16
Joined: Wed Mar 19, 2003 12:24 am

/alert problem - help!

Post by funmonkey » Sat May 03, 2003 10:56 pm

Hello,

I just recently compiled MQ and im having a very odd problem with the /alert function.

A simple /alert add 1 npc rat comes up with the error "cannot add alert without spawn name"

Ive tried many different variations and they all come up with the same thing (trust me ive tried them all lol)

Anyone else having this problem?

Valerian
a grimling bloodguard
a grimling bloodguard
Posts: 709
Joined: Sun Jul 28, 2002 3:29 am

Post by Valerian » Sun May 04, 2003 2:48 am

oh man, I had this problem, and do again... I think I fixed it once, but I'll have to dig through my old sources and find the fix again... forgot about that bug.

funmonkey
orc pawn
orc pawn
Posts: 16
Joined: Wed Mar 19, 2003 12:24 am

Post by funmonkey » Sun May 04, 2003 3:17 am

Oh man, if you could PLEASE find me the source I would be sooo happy. It's so very annoying =(

funmonkey
orc pawn
orc pawn
Posts: 16
Joined: Wed Mar 19, 2003 12:24 am

Post by funmonkey » Mon May 05, 2003 5:20 am

anyone? :( please?

Valerian
a grimling bloodguard
a grimling bloodguard
Posts: 709
Joined: Sun Jul 28, 2002 3:29 am

Post by Valerian » Mon May 05, 2003 7:08 am

heh, my fix for this is more of a kludge... apparently the stack get corrupted in there somewhere, and in the process of debugging it, it fixed itself. cut it down to 2 lines I added in (one being a variable declaration and one a sprintf())

in Alert():

Code: Select all

			} else if (!strcmp(szArg,"add")) {
				CHAR Buffer[MAX_STRING] = {0};
				CHAR szArg1[MAX_STRING] = {0};
				BOOL ParsingAdd = TRUE;
				DWORD List  = 0;
//KLUDGE: There appears to be a corrupted stack or computer amnesia.
// This fixes the "cannot add alert without spawn name" bug.
CHAR szMsg[MAX_STRING] = {0};
sprintf(szMsg,"%s %s %s",szArg, szRest, szLLine);
//END KLUDGE

funmonkey
orc pawn
orc pawn
Posts: 16
Joined: Wed Mar 19, 2003 12:24 am

Post by funmonkey » Mon May 05, 2003 5:53 pm

hey,

thank you for the fix, but I don't really know hot to fix this. Do I edit something then recomile? Or just edit something in my MQ folder?

Valerian
a grimling bloodguard
a grimling bloodguard
Posts: 709
Joined: Sun Jul 28, 2002 3:29 am

Post by Valerian » Mon May 05, 2003 6:12 pm

edit eqlib.cpp, that function is somewhere around the middle (you can search for /alert, it should be the second one it finds, and then scroll down a little)

I included some of the original code above the fix so you know where to put it. put it in, and recompile.

BTW, for those developers who feel like finding a permanent fix for this, the symptoms are: without that sprintf() there, szRest would disappear, and be an empty string. I'm not exactly sure why using it in a sprintf() would change things, but it does... also not sure if this bug exists at all if compiled in VC7... it could be an optimization that VC6 is set to use *shrug* haven't tried it in VC7 yet.

Valerian
a grimling bloodguard
a grimling bloodguard
Posts: 709
Joined: Sun Jul 28, 2002 3:29 am

Post by Valerian » Tue May 06, 2003 4:18 am

just compiled in VC7 without my fix, and verified that it does work properly... must be some obscure setting in VC6 that we haven't found yet to fix this...

funmonkey
orc pawn
orc pawn
Posts: 16
Joined: Wed Mar 19, 2003 12:24 am

Post by funmonkey » Wed May 07, 2003 1:54 am

Valerian,

Thank you very much for your help, I really apprecaite it.

Your fix worked, and im glad that my problem has been pointed out and can be worked out by the devs with a fix (luckily only small ammount of vc6 users are having the problem)

-fun

User avatar
dont_know_at_all
Developer
Developer
Posts: 5450
Joined: Sun Dec 01, 2002 4:15 am
Location: Florida, USA
Contact:

Post by dont_know_at_all » Sun May 18, 2003 4:21 am

Fixed in CVS.