View Single Post
Modifying parameters passed to PM_Move
Old
  (#1)
Lazy
Member
 
Lazy's Avatar
 
Status: Offline
Posts: 236
Join Date: Jan 2004
Location: Toronto, Ontario, Canada
Default Modifying parameters passed to PM_Move - 21-02-2008

With metamod there does not seem to be a way to modify the parameters passed to functions.
Take PM_Move for example, sure I can modify the parameters within my PM_Move function then call the mod's version but the problem is that even if I return MRES_SUPERCEDE other plugins will still have their PM_Move functions get called and if they do the same there could be trouble.

Example, typed in edit so it sucks:
Code:
void PM_Move( struct playermove_s* PMove, qboolean Server ) {
   PMove->blah = blah; // Do stuff with PMove
   MDLL_PM_Move( PMove, Server ); // Call mod's PM_Move with modified vars

   RETURN_META( MRES_SUPERCEDE );
}
Any ways around this?
I could overwrite the first few bytes of the mod's function with a jump to hook code which does what I want but that's really messy.
  
Reply With Quote