| PowerupGameObj::Grant() and C4GameObj::Detonate() [message #470397] | 
			Sun, 01 July 2012 03:57   | 
		 
		
			
				
				
				
					
						  
						iRANian
						 Messages: 4313 Registered: April 2011 
						
	Karma: 1
 
					 | 
					General (4 Stars)  | 
					 | 
		 
		 
	 | 
 
	
		After talking to StealthEye he told me that ::Grant() isn't jump hooked to the FDS' function, instead the function calling them being replaced completely (::Think() for both IIRC), and it seems to be the same for C4GameObj::Detonate(). 
 
Could a jump hook for the FDS' original functions for these replacements be added, so I can grab the address of 4.0's replacement functions in memory by checking the JMP at the start of the original functions? 
 
PowerupGameObj::Grant() is at 0x006F1100 
and C4GameObj::Detonate() is at 0x0070BE90 
 
I'm not sure if the 4.0 replacement functions are called in 4.0's replacement ::Think().
		
		
  Long time and well respected Renegade community member, programmer, modder and tester. 
 
Scripts 4.0 private beta tester since May 2011. 
 
My Renegade server plugins releases
		
 |  
	| 
		
	 | 
 
 
 | 
	| 
		
 | 
	| 
		
 | 
	| 
		
 | 
	| 
		
 | 
	
		
		
			| Re: PowerupGameObj::Grant() and C4GameObj::Detonate() [message #470614 is a reply to message #470397] | 
			Tue, 03 July 2012 03:54    | 
		 
		
			| 
				
	 | 
 
	
		I can confirm that both PowerUpGameObj::Think and PowerUpGameObj::Grant are (or should be baring bugs) 100% identical to the stock functions. 
 
PowerUpGameObj::Grant does something like this: 
Get_Definition().Grant( obj, this ); 
 
if ( WeaponBag != NULL ) 
if ( obj->Get_Weapon_Bag()->Move_Contents( WeaponBag ) ) 
Set_State( PowerUpGameObj::STATE_GRANTING ); 
 
if ( State == STATE_GRANTING ) 
Send CUSTOM_EVENT_POWERUP_GRANTED to all scripts on the PowerUpGameObj 
 
Note that this is the only place in the stock code that I can find that sends CUSTOM_EVENT_POWERUP_GRANTED 
		
		
  Jonathan Wilson aka Jonwil 
Creator and Lead Coder of the Custom scripts.dll 
Renegade Engine Guru 
Creator and Lead Coder of TT.DLL 
Official member of Tiberian Technologies 
		
 |  
	| 
		
	 | 
 
 
 | 
	| 
		
 | 
	| 
		
 | 
	| 
		
 | 
	| 
		
 | 
	| 
		
 | 
	| 
		
 | 
	| 
		
 |