Jump to content
  • 0

Is this a bug or "feature"?


Gamer_Z

Question

look at the commented lines "bAlreadyInited = true;//":

  
/** 
 * This adds the local player to the ped pool, nothing else 
 * @return BOOL TRUE if success, FALSE otherwise 
 */ 
BOOL CGameSA::InitLocalPlayer(  ) 
{ 
    DEBUG_TRACE("BOOL CGameSA::InitLocalPlayer(  )"); 
  
    // Added by ChrML - Looks like it isn't safe to call this more than once but mod code might do 
    static bool bAlreadyInited = false; 
    if ( bAlreadyInited ) 
    { 
        return TRUE; 
    } 
    //bAlreadyInited = true;//Current MTA Code, wtf is this doing here? 
    CPoolsSA * pools = (CPoolsSA *)this->GetPools (); 
    if ( pools ) 
    { 
        //* HACKED IN HERE FOR NOW *// 
        CPedSAInterface* pInterface = pools->GetPedInterface ( (DWORD)1 ); 
  
        if ( pInterface ) 
        { 
            pools->AddPed ( (DWORD*)pInterface ); 
            bAlreadyInited = true;//only set to true when local player was succesfully added, right? 
            return TRUE; 
        } 
  
        return FALSE; 
    } 
    return FALSE; 
} 

Link to comment

2 answers to this question

Recommended Posts

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...