Raised This Month: $ Target: $400
 0% 

[TF2] Friendly Pyro Fire - FlameThrower


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Swixel
Senior Member
Join Date: Jul 2010
Location: Sydney, Australia
Old 11-09-2010 , 23:51   Re: [TF2] Friendly Pyro Fire - FlameThrower
Reply With Quote #5

Well Valve checks block it from working outside of friendlyfire *anyway*, so that detour (as is) just enables the flamethrower whenever mp_friendlyfire is on. Otherwise Valve's later check (done by the CTFFlamethrower itself) disables it ...

If you're worried you could always do what I'm doing, and check against an enable cvar (or even check the detour status against mp_friendlyfire):

PHP Code:
// Somewhere up the top, nicely, to declare it
ConVar *cv_FF;

// Within the SDK_OnLoad function
    
cv_FF g_pCVar->FindVar("mp_friendlyfire");

// Within the detour
if(cv_FF->GetBool())
{
/* rest of the detour code */
}
else
{
  return 
TeamCollision;

Or you could just destroy the detour every time cv_FF changes...

PHP Code:
// Declare this somewhere
static void FFCallbackIConVar *var, const char *pOldValuefloat flOldValue )
{
    if(
cv_FF->GetBool())
    {
        
uradetour->EnableDetour();
    }
    else
    {
        
uradetour->DisableDetour();
    }
}

// within OnLoad, after cv_FF is "found"
cv_FF->InstallChangeCallback(FFCallBack); 
* shrugs *

Last edited by Swixel; 11-10-2010 at 04:49. Reason: additionally, asherkin's other point over IRC was very valid
Swixel is offline
 



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 18:42.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode