From 1e9fcf61041bb69a19305d999db35a9c379c1d6f Mon Sep 17 00:00:00 2001 From: jjak0b <32840785+jjak0b@users.noreply.github.com> Date: Sun, 2 Feb 2020 21:39:09 +0100 Subject: [PATCH] * Fix Projectile Callback_OnCollide evento che non si verificava prima delle agginte delle dimenticanze --- src/entities/Projectile.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/entities/Projectile.cpp b/src/entities/Projectile.cpp index d2fecb6..628a5f6 100644 --- a/src/entities/Projectile.cpp +++ b/src/entities/Projectile.cpp @@ -1,5 +1,6 @@ #include "Projectile.hpp" #include "engine/GameEngine.hpp" +#include Projectile::Projectile( Level *world, Point2D origin, Vector direction, double damage, const char classname[], VECTOR_VALUE_TYPE speed, double _lifetime ) : DynamicEntity( world, origin, NULL , classname, speed){ this->direction = direction; @@ -49,7 +50,8 @@ bool Projectile::Update( GameEngine *game ) { } void Projectile::Callback_OnCollide( GameEngine *game, Entity *collide_ent ) { - this->shouldDeleteOnUpdate = true; + if( strcmp( this->GetClassname(), collide_ent->GetClassname() ) ) + this->shouldDeleteOnUpdate = true; }