diff options
Diffstat (limited to 'src/core/entityprojectile.cc')
-rw-r--r-- | src/core/entityprojectile.cc | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/src/core/entityprojectile.cc b/src/core/entityprojectile.cc index 8c6c57b..e89c7f7 100644 --- a/src/core/entityprojectile.cc +++ b/src/core/entityprojectile.cc @@ -56,10 +56,12 @@ void EntityProjectile::collision(Entity *other) { if (state() == Entity::Destroyed) { return; + } else { + if ((other->type() == Dynamic) || (other->type() == Controlable)) { + static_cast<EntityDynamic *>(other)->hit(this); + } + set_state(Entity::Destroyed); } - - set_state(Entity::Destroyed); - // this method is a bullet callback, we can not reset() here } void EntityProjectile::frame(const unsigned long elapsed) |