View Single Post
Re: Problem with the sounds in AMX
Old
  (#9)
Whistler
Summoner
 
Whistler's Avatar
 
Status: Offline
Posts: 1,499
Join Date: Feb 2004
Location: Mist Village
Default Re: Problem with the sounds in AMX - 28-05-2005

nah...

suppose this is what's passed in the parameter "pengfuncsFromEngine" to the bot dll:

note: for simplification, let's suppose the enginefuncs_t only contains pfnFunc1, pfnFunc2, pfnFunc3:

PHP Code:
pfnFunc1          pfnFunc2          pfnFunc3
ENGINE_func1      ENGINE_func1      ENGINE_func3 
ENGINE_func* means the address of functions in the original engine, so that gamedll can call it

then if you do this...

pengfuncsFromEngine->pfnFunc1 = bot_func1;
pengfuncsFromEngine->pfnFunc2 = bot_func2;
pengfuncsFromEngine->pfnFunc3 = bot_func3;

this will be passed into the original game dll:

PHP Code:
pfnFunc1          pfnFunc2          pfnFunc3
bot_func1         bot_func2         bot_func3 
...and just like what HPB bot does, bot_func1 will call the ENGINE_func1

but if you do this...

pengfuncsFromEngine->pfnFunc1 = bot_func1;

and leave the pfnFunc2, pfnFunc3 untouched. We'll get result like this:

PHP Code:
pfnFunc1          pfnFunc2         pfnFunc3
bot_func1         ENGINE_func2     ENGINE_func3 
...and now, this will be passed into the original gamedll and the gamedll can still call the ENGINE_func2 directly using g_engfuncs.pfnFunc2().

you can just choose not to "hijack" a certain engine function in the game dll, and it will be okay. No need to "hijack" every functions.
  
Reply With Quote