diff --git a/sources/Items/Bonus.cpp b/sources/Items/Bonus.cpp index 6d2ce28d..56a59fba 100644 --- a/sources/Items/Bonus.cpp +++ b/sources/Items/Bonus.cpp @@ -76,7 +76,6 @@ namespace BBM { float value = (distribution(generator) / 10); BonusType bonus = NOTHING; - std::cout << value << std::endl; for (auto &chance : chanceValue) if (chance.second > value) bonus = chance.first; diff --git a/sources/Map/Map.cpp b/sources/Map/Map.cpp index e309f19b..9c884f56 100644 --- a/sources/Map/Map.cpp +++ b/sources/Map/Map.cpp @@ -261,7 +261,6 @@ namespace BBM scene->addEntity("Floor") .addComponent(Vector3f(coords)) - //.addComponent(1) .addComponent(floorObj, false, std::make_pair(MAP_DIFFUSE, floorPng)); } diff --git a/sources/System/Bonus/PlayerBonusSystem.cpp b/sources/System/Bonus/PlayerBonusSystem.cpp index 242b99c6..18c8e6c2 100644 --- a/sources/System/Bonus/PlayerBonusSystem.cpp +++ b/sources/System/Bonus/PlayerBonusSystem.cpp @@ -28,11 +28,9 @@ namespace BBM auto playerHealth = entity->tryGetComponent(); if (!playerHealth || !playerPos) return; - for (auto &[other, pos, _] : this->_wal.getScene()->view()) { - if (other.hasComponent>()) - continue; - auto vec = playerPos->position.abs() - pos.position.abs(); - if (vec.abs().x < 0.65 && vec.abs().z < 0.65 && playerPos->position.distance(pos.position) < 1) + for (auto &[other, pos, _] : this->_wal.getScene()->view>()) { + auto vec = (playerPos->position - pos.position).abs(); + if (vec.x < 0.65 && vec.z < 0.65 && playerPos->position.distance(pos.position) < 1) playerHealth->takeDmg(playerHealth->getHealthPoint()); } } diff --git a/sources/System/Controllable/ControllableSystem.cpp b/sources/System/Controllable/ControllableSystem.cpp index a5979f6f..b823547f 100644 --- a/sources/System/Controllable/ControllableSystem.cpp +++ b/sources/System/Controllable/ControllableSystem.cpp @@ -18,7 +18,6 @@ namespace BBM { auto &controllable = entity.get(); auto &movable = entity.get(); - auto health = entity->tryGetComponent(); Vector2f move = controllable.move.normalized() * controllable.speed; movable.addForce(Vector3f(move.x, 0, move.y)); diff --git a/sources/System/Renderer/CameraSystem.cpp b/sources/System/Renderer/CameraSystem.cpp index d8dcd8d7..77cacde0 100644 --- a/sources/System/Renderer/CameraSystem.cpp +++ b/sources/System/Renderer/CameraSystem.cpp @@ -60,8 +60,6 @@ namespace BBM float lowerZDist = 0; for (auto &[player, position, _] : this->_wal.getScene()->view>()) { - if (!player.hasComponent()) - player.addComponent(); playerPos.emplace_back(position.position); } if (playerPos.size() == 1)