SVN Builds
#20
Weird this code should work right ?
Code:
void cCow::KilledBy( cEntity* a_Killer )
{
    //1 to 3 raw beef.
    int rRawBeef = rand() % 1 + 3;
    if (rRawBeef != 0) {
        cPickup* pRawBeef = new cPickup( (int)(m_Pos->x*32), (int)(m_Pos->y*32), (int)(m_Pos->z*32), cItem( E_ITEM_RAW_BEEF, rRawBeef ) );
        pRawBeef->Initialize( GetWorld() );
    }
    //0 to 2 leather.
    int rLeather = rand() % 3;
    if (rLeather != 0) {
        cPickup* pLeather = new cPickup( (int)(m_Pos->x*32), (int)(m_Pos->y*32), (int)(m_Pos->z*32), cItem( E_ITEM_LEATHER, rLeather ) );
        pLeather->Initialize( GetWorld() );
    }

    cMonster::KilledBy( a_Killer );
}
Still it crashes the client when i kill a cow.
Reply
Thanks given by:


Messages In This Thread



Users browsing this thread: 6 Guest(s)