.:: Bots United ::.

.:: Bots United ::. (http://forums.bots-united.com/index.php)
-   Half-Life 1 SDK (http://forums.bots-united.com/forumdisplay.php?f=33)
-   -   Modifying parameters passed to PM_Move (http://forums.bots-united.com/showthread.php?t=6653)

Lazy 21-02-2008 01:24

Modifying parameters passed to PM_Move
 
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.


All times are GMT +2. The time now is 16:14.

Powered by vBulletin® Version 3.8.2
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.