From b8ff1dcd4e531c3c858ee09f705cf553e86ed7ff Mon Sep 17 00:00:00 2001 From: Max-001 Date: Wed, 8 Jan 2025 09:07:46 +0100 Subject: Adjusted script --- game/workers/CollisionScript.cpp | 20 +------------------- 1 file changed, 1 insertion(+), 19 deletions(-) diff --git a/game/workers/CollisionScript.cpp b/game/workers/CollisionScript.cpp index 9e9b981..baa058b 100644 --- a/game/workers/CollisionScript.cpp +++ b/game/workers/CollisionScript.cpp @@ -1,9 +1,6 @@ #include "CollisionScript.h" #include -#include -#include - using namespace crepe; using namespace std; @@ -15,9 +12,7 @@ void CollisionScript::init() { } bool CollisionScript::on_collision(const CollisionEvent & ev) { - RefVector animators = this->get_components_by_name("player"); - RefVector emitters - = this->get_components_by_name("player"); + RefVector animators = this->get_components(); if (ev.info.other.metadata.tag == "zapper") { for (Animator & anim : animators) { @@ -25,9 +20,6 @@ bool CollisionScript::on_collision(const CollisionEvent & ev) { anim.set_anim(4); anim.data.looping = true; } - for (ParticleEmitter & emitter : emitters) { - emitter.data.emission_rate = 0; - } return true; } else if (ev.info.other.metadata.tag == "laser") { @@ -36,11 +28,6 @@ bool CollisionScript::on_collision(const CollisionEvent & ev) { anim.set_anim(4); anim.data.looping = true; } - for (ParticleEmitter & emitter : emitters) { - emitter.data.emission_rate = 0; - } - play_scr.active = false; - end_scr.active = true; return true; } else if (ev.info.other.metadata.tag == "missile") { @@ -49,11 +36,6 @@ bool CollisionScript::on_collision(const CollisionEvent & ev) { anim.set_anim(5); anim.data.looping = true; } - for (ParticleEmitter & emitter : emitters) { - emitter.data.emission_rate = 0; - } - play_scr.active = false; - end_scr.active = true; return true; } -- cgit v1.2.3