diff --git a/CMakeLists.txt b/CMakeLists.txt index c478e53..fc4f233 100755 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -89,7 +89,7 @@ add_executable(shooter engine/animation/AFunction.h ) -if(${APPLE}) +if(APPLE OR UNIX) include_directories(/usr/local/include) else() set(SFML_DIR "C:/Libraries/SFML/lib/cmake/SFML") diff --git a/Player.cpp b/Player.cpp index 46b8b3a..d33e655 100755 --- a/Player.cpp +++ b/Player.cpp @@ -164,8 +164,6 @@ void Player::update() { } } } - - oldVelocity = velocity(); } void Player::rotateWeaponsRelativePoint(const Point4D& point4D, const Point4D& v, double val) { diff --git a/Player.h b/Player.h index 3cdcc73..e0ffd29 100755 --- a/Player.h +++ b/Player.h @@ -53,10 +53,7 @@ private: sf::Sound unSlowMoSound; sf::Sound fullHealthSound; sf::Sound fullAbilitySound; - - - Point4D oldVelocity; - + std::string _name = "im"; std::vector> _weapons; diff --git a/Server.cpp b/Server.cpp index 6df97ea..ed8c404 100755 --- a/Server.cpp +++ b/Server.cpp @@ -155,7 +155,7 @@ void Server::generateBonuses() { void Server::updateInfo() { for(auto& bonus : _bonuses) { - if(!bonus.second.onTheMap && abs(Time::time() - bonus.second.lastTake) > _bonusRechargeTime) { + if(!bonus.second.onTheMap && std::abs(Time::time() - bonus.second.lastTake) > _bonusRechargeTime) { sf::Packet sendPacket; sendPacket << MsgType::AddBonus << bonus.first << bonus.second.position.x() << bonus.second.position.y() << bonus.second.position.z(); for (const auto& player : _players) diff --git a/Weapon.cpp b/Weapon.cpp index 2565da5..c5559e3 100755 --- a/Weapon.cpp +++ b/Weapon.cpp @@ -32,7 +32,7 @@ std::map Weapon::fire(const std::shared_ptr& world, noAmmoSound.play(); } - if(_clipAmmo <= 0 || abs(Time::time() - _lastFireTime) < _fireDelay || abs(Time::time() - _lastReloadTime) < _reloadTime) + if(_clipAmmo <= 0 || std::abs(Time::time() - _lastFireTime) < _fireDelay || std::abs(Time::time() - _lastReloadTime) < _reloadTime) return std::map(); _lastFireTime = Time::time(); @@ -45,7 +45,7 @@ std::map Weapon::fire(const std::shared_ptr& world, } void Weapon::reload() { - if (_stockAmmo == 0 || abs(Time::time() - _lastReloadTime) < _reloadTime) + if (_stockAmmo == 0 || std::abs(Time::time() - _lastReloadTime) < _reloadTime) return; if(_clipCapacity - _clipAmmo <= _stockAmmo) { _stockAmmo -= _clipCapacity - _clipAmmo; diff --git a/Weapon.h b/Weapon.h index ff4db0c..cdb6c72 100755 --- a/Weapon.h +++ b/Weapon.h @@ -27,8 +27,6 @@ protected: double _spreading = 2.0; - [[maybe_unused]] double _firePower = M_PI/100; - std::string _name = "Weapon_name"; std::map> _objects; diff --git a/engine/physics/RigidBody.cpp b/engine/physics/RigidBody.cpp index 5aa5bfc..98387e2 100755 --- a/engine/physics/RigidBody.cpp +++ b/engine/physics/RigidBody.cpp @@ -191,7 +191,7 @@ CollisionPoint RigidBody::EPA(const Simplex& simplex, const std::shared_ptr 0.0001) { + if (std::abs(sDistance - minDistance) > 0.0001) { minDistance = INFINITY; std::vector> uniqueEdges;