11-08-2011, 11:44 AM
Variable scope issues perhaps. Enclosing the individual cPickup* Pickup ensures there's no overlap.
Code:
void cCavespider::KilledBy( cEntity* a_Killer )
{
{
//0 to 1 spider eye - 1.9 pre2
cPickup* Pickup = new cPickup( (int)(m_Pos->x*32), (int)(m_Pos->y*32), (int)(m_Pos->z*32), cItem( E_ITEM_SPIDER_EYE, (rand() % 1) ) );
Pickup->Initialize( GetWorld() );
}
{
//0 to 2 string.
cPickup* Pickup = new cPickup( (int)(m_Pos->x*32), (int)(m_Pos->y*32), (int)(m_Pos->z*32), cItem( E_ITEM_STRING, (rand() % 3) ) );
Pickup->Initialize( GetWorld() );
}
cMonster::KilledBy( a_Killer );
}