Page 1 of 1

/alert problem - help!

Posted: Sat May 03, 2003 10:56 pm
by funmonkey
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?

Posted: Sun May 04, 2003 2:48 am
by Valerian
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.

Posted: Sun May 04, 2003 3:17 am
by funmonkey
Oh man, if you could PLEASE find me the source I would be sooo happy. It's so very annoying =(

Posted: Mon May 05, 2003 5:20 am
by funmonkey
anyone? :( please?

Posted: Mon May 05, 2003 7:08 am
by Valerian
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

Posted: Mon May 05, 2003 5:53 pm
by funmonkey
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?

Posted: Mon May 05, 2003 6:12 pm
by Valerian
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.

Posted: Tue May 06, 2003 4:18 am
by Valerian
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...

Posted: Wed May 07, 2003 1:54 am
by funmonkey
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

Posted: Sun May 18, 2003 4:21 am
by dont_know_at_all
Fixed in CVS.