The following warnings occurred:
Warning [2] Undefined array key 0 - Line: 1677 - File: showthread.php PHP 8.3.36 (Linux)
File Line Function
/inc/class_error.php 157 errorHandler->error
/showthread.php 1677 errorHandler->error_callback
/showthread.php 916 buildtree




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: 2 Guest(s)