From 5646c0ecbd907e869ae5e6d8faa3d44391027138 Mon Sep 17 00:00:00 2001 From: Zoe Roux Date: Thu, 10 Jun 2021 11:31:32 +0200 Subject: [PATCH] Bomb collisions should be good --- sources/Component/Bomb/BasicBombComponent.cpp | 2 +- sources/Component/Bomb/BasicBombComponent.hpp | 6 +++--- sources/Runner/Runner.cpp | 16 +++----------- sources/System/Bomb/BombSystem.cpp | 21 +++++++++++++------ sources/System/Bomb/BombSystem.hpp | 5 +++-- .../System/BombHolder/BombHolderSystem.cpp | 7 ++++--- .../System/BombHolder/BombHolderSystem.hpp | 5 +++-- 7 files changed, 32 insertions(+), 30 deletions(-) diff --git a/sources/Component/Bomb/BasicBombComponent.cpp b/sources/Component/Bomb/BasicBombComponent.cpp index dcf9627e..97cbb70d 100644 --- a/sources/Component/Bomb/BasicBombComponent.cpp +++ b/sources/Component/Bomb/BasicBombComponent.cpp @@ -6,7 +6,7 @@ namespace BBM { - BasicBombComponent::BasicBombComponent(WAL::Entity &entity, int damage, float explosionRadius, int ownerID) + BasicBombComponent::BasicBombComponent(WAL::Entity &entity, int damage, int explosionRadius, unsigned ownerID) : WAL::Component(entity), damage(damage), explosionRadius(explosionRadius), diff --git a/sources/Component/Bomb/BasicBombComponent.hpp b/sources/Component/Bomb/BasicBombComponent.hpp index 988304d2..1b9b46bf 100644 --- a/sources/Component/Bomb/BasicBombComponent.hpp +++ b/sources/Component/Bomb/BasicBombComponent.hpp @@ -16,11 +16,11 @@ namespace BBM { public: //! @brief The radius of the explosion. - const float explosionRadius = 3; + const int explosionRadius = 3; //! @brief The damage made by the explosion on an entity const int damage = 1; //! @brief The ID of the owner. - int ownerID; + unsigned ownerID; //! @brief Should collisions with the owner be disabled.² bool ignoreOwner = true; @@ -28,7 +28,7 @@ namespace BBM WAL::Component *clone(WAL::Entity &entity) const override; //! @brief A component can't be instantiated, it should be derived. - explicit BasicBombComponent(WAL::Entity &entity, int damage, float explosionRadius, int ownerID); + explicit BasicBombComponent(WAL::Entity &entity, int damage, int explosionRadius, unsigned ownerID); //! @brief A component can't be instantiated, it should be derived. BasicBombComponent(const BasicBombComponent &) = default; diff --git a/sources/Runner/Runner.cpp b/sources/Runner/Runner.cpp index 6a9217f3..0601b681 100644 --- a/sources/Runner/Runner.cpp +++ b/sources/Runner/Runner.cpp @@ -7,12 +7,7 @@ #include "System/Movable/MovableSystem.hpp" #include "System/Renderer/RenderSystem.hpp" #include -#include -#include #include -#include