/** * @brief * Called when a scene node was found */ void SNProjectile::OnSceneNode(SceneQuery &cQuery, SceneNode &cSceneNode) { // Is this projectile still active? if (IsActive()) { // Is this a bomb? if (cSceneNode.IsInstanceOf("SNBomb")) { // Is the bomb still alive? if (!cSceneNode.GetAttribute("Killed")->GetBool()) { // Jap, kill the bomb right now cSceneNode.SetAttribute("Killed", "1"); // Destroy this projectile Delete(); // Done, do NOT continue the query! cQuery.Stop(); } // Is this the UFO? (can not be killed :) } else if (cSceneNode.IsInstanceOf("SNUFO")) { // Jap, destroy this projectile Delete(); // Done, do NOT continue the query! cQuery.Stop(); } } }
/** * @brief * Called when a scene node was found */ void SNGun::OnSceneNode(SceneQuery &cQuery, SceneNode &cSceneNode) { // Is this gun still active? if (IsActive()) { // Is this a bomb? if (cSceneNode.IsInstanceOf("SNBomb")) { // Is the bomb still alive? if (!cSceneNode.GetAttribute("Killed")->GetBool()) { // Jap, kill the bomb right now cSceneNode.SetAttribute("Killed", "1"); // Destroy this gun Delete(); // Done, do NOT continue the query! cQuery.Stop(); } } } }