Re: hey stefan... -
05-06-2004
My fix for the glass bug was not to call the same function twice! You misunderstood it I see.
You mustn't call the same function twice, you must call 2 DIFFERENT, SUCCESSIVE HOOKS, for the Spawn() function.
The first hook occurs BEFORE the actual Spawn() function from the gameDLL is called: it's the normal hook your code already uses. It tells you that an entity is about to be spawned. This hook is declared in metamod's gFunctionTable.
The SECOND hook, which IS the fix, occurs AFTER the actual Spawn() function from the gameDLL is called, in order to "correct" one parameter in the entity which has just been spawned. And since we want to do this AFTER the entity has spawned, we must then declare it in metamod's gFunctionTable_Post table.
Whistler is completely right, and your GetEntityAPI2_Post function should be just like what he says. There has never been any "purpose" in calling the same functions twice but to produce horrible things like memory leaks, array indices getting out of bounds, and general fuckups everywhere. I'm starting to be more and more convinced that RealBot is driven by magic! o_O
RACC home - Bots-United: beer, babies & bots (especially the latter)
"Learn to think by yourself, else others will do it for you."
|