Woes of MQ2Spawns.cpp

Need help running MacroQuest2? Ask your questions about how to get things to work on your computer.

Moderator: MacroQuest Developers

Preocts
a snow griffon
a snow griffon
Posts: 312
Joined: Thu Jan 29, 2004 1:02 pm

Woes of MQ2Spawns.cpp

Post by Preocts » Mon Mar 15, 2004 4:35 am

Code: Select all

Compiling...
MQ2Spawns.cpp
MQ2Spawns.cpp(75) : error C2420: 'EQItemList_Trampoline' : illegal symbol in first operand
MQ2Spawns.cpp(76) : error C2415: improper operand type
MQ2Spawns.cpp(90) : warning C4035: 'EQItemList_Detour' : no return Value
MQ2Spawns.cpp(101) : error C2420: 'dEQItemList_Trampoline' : illegal symbol in first operand
MQ2Spawns.cpp(102) : error C2415: improper operand type
Error executing cl.exe.

MQ2Spawns.obj - 4 error(s), 1 warning(s)
Bleh, I'm VB coder not a C+ wiz. Errr, help.

Getting this as I'm building MQ2Main.dll as per the instructions that I've followed for years now :?

Gonna dig into it mahself and see if I can figure out why I'm getting errors when I never did before. /shrug.

---Edit
:evil: is all I have to say about this. I no have da skillz 4 this! sigh, glad to know, at least, that I'm not the only programmer in the world that has random problems appear in his code.
Last edited by Preocts on Mon Mar 15, 2004 10:32 am, edited 1 time in total.

DJPrez
a lesser mummy
a lesser mummy
Posts: 46
Joined: Fri Feb 07, 2003 11:34 pm

Post by DJPrez » Mon Mar 15, 2004 5:13 am

Aye,,, same here ::

Code: Select all

MQ2Spawns.cpp
C:\Documents and Settings\DJPrez\Desktop\MQ2-Latest\MQ2Main\MQ2Spawns.cpp(75) : error C2420: 'EQItemList_Trampoline' : illegal symbol in first operand
C:\Documents and Settings\DJPrez\Desktop\MQ2-Latest\MQ2Main\MQ2Spawns.cpp(76) : error C2415: improper operand type
C:\Documents and Settings\DJPrez\Desktop\MQ2-Latest\MQ2Main\MQ2Spawns.cpp(90) : warning C4035: 'EQItemList_Detour' : no return value
C:\Documents and Settings\DJPrez\Desktop\MQ2-Latest\MQ2Main\MQ2Spawns.cpp(101) : error C2420: 'dEQItemList_Trampoline' : illegal symbol in first operand
C:\Documents and Settings\DJPrez\Desktop\MQ2-Latest\MQ2Main\MQ2Spawns.cpp(102) : error C2415: improper operand type

smelly wang
a lesser mummy
a lesser mummy
Posts: 54
Joined: Mon Jan 19, 2004 6:04 pm

Post by smelly wang » Mon Mar 15, 2004 5:35 am

Code: Select all

	DWORD EQItemList_Detour()
	{
		[color=red]EQItemList_Trampoline();[/color]
		__asm {
			push eax;
			push ebx;
			push ecx;
			push edx;
			push esi;
			push edi;
			call AddGroundItem;
			pop edi;
			pop esi;
			pop edx;
			pop ecx;
			pop ebx;
			pop eax;
		};
	}

Code: Select all

		__asm {
			push ecx;
			push ecx;
			call RemoveGroundItem;
			pop ecx;
			pop ecx;
		};
		[color=red]dEQItemList_Trampoline();[/color]

Code: Select all

	void dEQPlayer_Detour(void)
	{
		__asm {
			push ecx;
			push ecx;
			call PluginsRemoveSpawn;
			pop ecx;
			pop ecx;
		};
		[color=red]dEQPlayer_Trampoline();[/color]
/*
		PSPAWNINFO pSpawn;
		__asm {mov [pSpawn], ecx};
		__asm {push ecx};
//		PreserveRegisters(PluginsRemoveSpawn((PSPAWNINFO)pSpawn));
		PluginsRemoveSpawn((PSPAWNINFO)pSpawn);
		__asm {pop ecx};
		dEQPlayer_Trampoline();
/**/
	}

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 » Mon Mar 15, 2004 5:35 am

Untested, but compiles and should work:

Code: Select all

Index: MQ2Spawns.cpp
===================================================================
RCS file: /cvsroot/macroquest/macroquest2/MQ2Main/MQ2Spawns.cpp,v
retrieving revision 1.4
diff -u -r1.4 MQ2Spawns.cpp
--- MQ2Spawns.cpp	15 Mar 2004 02:41:10 -0000	1.4
+++ MQ2Spawns.cpp	15 Mar 2004 10:24:02 -0000
@@ -71,8 +71,9 @@
 	DWORD EQItemList_Trampoline();
 	DWORD EQItemList_Detour()
 	{
+            unsigned long (EQItemListHook::*tmp)(void) = EQItemList_Trampoline;
 		__asm {
-			call EQItemList_Trampoline;
+			call [tmp];
 			push eax;
 			push ebx;
 			push ecx;
@@ -92,13 +93,14 @@
 	void dEQItemList_Trampoline();
 	void dEQItemList_Detour()
 	{
+            void (EQItemListHook::*tmp)(void) = dEQItemList_Trampoline;
 		__asm {
 			push ecx;
 			push ecx;
 			call RemoveGroundItem;
 			pop ecx;
 			pop ecx;
-			call dEQItemList_Trampoline;
+			call [tmp];
 		};
 	}
 };
@@ -143,13 +145,14 @@
 	void dEQPlayer_Trampoline(void);
 	void dEQPlayer_Detour(void)
 	{
+            void (EQPlayerHook::*tmp)(void) = dEQPlayer_Trampoline;
 		__asm {
 			push ecx;
 			push ecx;
 			call PluginsRemoveSpawn;
 			pop ecx;
 			pop ecx;
-			call dEQPlayer_Trampoline;
+			call [tmp];
 		};
 /*
 		PSPAWNINFO pSpawn;

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 » Mon Mar 15, 2004 5:37 am

This may be fixed by VS6SP5. I'd like some confirmation one way or another, please, if someone has SP5 installed.

User avatar
Kint
a hill giant
a hill giant
Posts: 208
Joined: Thu Mar 13, 2003 3:36 am

Post by Kint » Mon Mar 15, 2004 6:42 am

just installed SP5, still got those 4 errors so reverting back to the fix you posted in the diff.

edit: although I do get this warning with the diff'd changes
'EQItemList_Detour' : no return value

Preocts
a snow griffon
a snow griffon
Posts: 312
Joined: Thu Jan 29, 2004 1:02 pm

Wonderful

Post by Preocts » Mon Mar 15, 2004 7:04 am

Ran those changes through and no more errors. I don't pretend to understand what I just did but hey, it works and that is what counts. Maybe if I'm bored and have a month to spare I'll walk the whole source and then might understand a quarter of it.

Thanks for the fix anyways! :D

DJPrez
a lesser mummy
a lesser mummy
Posts: 46
Joined: Fri Feb 07, 2003 11:34 pm

Post by DJPrez » Mon Mar 15, 2004 9:41 am

I just installed Service pack 5 and still receive the errors =(

Code: Select all

MQ2Spawns.cpp
C:\Documents and Settings\DJPrez\Desktop\MQ2-Latest\MQ2Main\MQ2Spawns.cpp(75) : error C2420: 'EQItemList_Trampoline' : illegal symbol in first operand
C:\Documents and Settings\DJPrez\Desktop\MQ2-Latest\MQ2Main\MQ2Spawns.cpp(76) : error C2415: improper operand type
C:\Documents and Settings\DJPrez\Desktop\MQ2-Latest\MQ2Main\MQ2Spawns.cpp(90) : warning C4035: 'EQItemList_Detour' : no return value
C:\Documents and Settings\DJPrez\Desktop\MQ2-Latest\MQ2Main\MQ2Spawns.cpp(101) : error C2420: 'dEQItemList_Trampoline' : illegal symbol in first operand
C:\Documents and Settings\DJPrez\Desktop\MQ2-Latest\MQ2Main\MQ2Spawns.cpp(102) : error C2415: improper operand type
MQ2UserVars.cpp
MQ2Utilities.cpp
MQ2Windows.cpp
Error executing cl.exe.

MQ2Main.dll - 4 error(s), 1 warning(s)



+,,, what were we suppose to do *exactly* with that new code above? Copy and paste over the Spawn.cpp file? Add it somewhere? Create a new plugin? I was uncertain as what to do to try it out. Thanks =)

Preocts
a snow griffon
a snow griffon
Posts: 312
Joined: Thu Jan 29, 2004 1:02 pm

Post by Preocts » Mon Mar 15, 2004 10:33 am

+,,, what were we suppose to do *exactly* with that new code above? Copy and paste over the Spawn.cpp file? Add it somewhere? Create a new plugin? I was uncertain as what to do to try it out. Thanks =)

Code: Select all

[color=blue]@@ -71,8 +71,9 @@[/color]
   DWORD EQItemList_Trampoline(); 
   DWORD EQItemList_Detour() 
   { 
[color=red]+[/color]            unsigned long (EQItemListHook::*tmp)(void) = EQItemList_Trampoline; 
      __asm { 
[color=red]-[/color]         call EQItemList_Trampoline; 
[color=red]+[/color]         call [tmp]; 
         push eax; 
         push ebx; 
         push ecx; 
Remove the line with the -
Add the line with the +

The Location is given with the @ numbers. That's line number 71 in this snippet. Don't include the '+''s btw, just the code.[/code]

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 » Mon Mar 15, 2004 11:38 am

oh man... vs6 really is the retarded child. ah well, tested this on my other machine, cvsed it, and now im going to update the 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

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 » Mon Mar 15, 2004 11:50 am

fixed, locking thread. if you have a new issue post a new fucking thread.
Lax Lacks
Master of MQ2 Disaster
Purveyor of premium, EULA-safe MMORPG Multiboxing Software
* Multiboxing with ISBoxer: Quick Start Video
* EQPlayNice, WinEQ 2.0