1 BOOL SmashPcItem::Update(void) 2 { 3 if (mu32TimeToLive) 4 { 5 if (timeGetTime() > mu32TimeToLive) 6 { 7 // Mark Item for deletion 8 mbActive = FALSE; 9 GameSound::Play("Despawn"); 10 return FALSE; 11 } 12 } 13 14 // Release Enemies into the level 15 if (mpItemDetails->Type == "EnemySpawn") 16 { 17 if (mu32NumReleaseLeft && (mu32LastRelease + mpItemDetails->u32ReleaseRate < timeGetTime())) 18 { 19 SmashPcEnemy *pEnemy; 20 mu32LastRelease = timeGetTime(); 21 mu32NumReleaseLeft--; 22 23 // Create an enemy 24 pEnemy = new SmashPcEnemy(mGameData, mpApp, mpSpace, 25 mpBody->p, mpItemDetails->u32EnemyLevel); 26 27 // Check if this enemy should release something 28 mGameData.AddActiveEnemy(pEnemy); 29 30 } 31 } 32 33 return mbActive; 34 }