From 9c5ecea867912d5ba03586485031040d4611184b Mon Sep 17 00:00:00 2001 From: Guillaume Dupuy Date: Fri, 14 Oct 2016 21:19:27 +0200 Subject: [PATCH] Use speed as an int instead of float to calculate latency --HG-- branch : fix_speed --- .../entities_game_service/phrase_manager/combat_attacker.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/code/ryzom/server/src/entities_game_service/phrase_manager/combat_attacker.cpp b/code/ryzom/server/src/entities_game_service/phrase_manager/combat_attacker.cpp index ca03d0cff..9ec8462d1 100644 --- a/code/ryzom/server/src/entities_game_service/phrase_manager/combat_attacker.cpp +++ b/code/ryzom/server/src/entities_game_service/phrase_manager/combat_attacker.cpp @@ -131,7 +131,7 @@ CCombatWeapon::CCombatWeapon(CGameItemPtr itemPtr) if (itemPtr->hitRate() != 0) { //getGameTimeStep() is actually a double and hitRate() a float, so the precision difference will make a cast of the result fail (for example, with hitRate() == 10.0f, the cast will give a value of 9 and not 10 - LatencyInTicks = uint16 ( (10.0f / itemPtr->hitRate() ) / float(CTickEventHandler::getGameTimeStep()) ); + LatencyInTicks = uint16 ( (10.0f / uint16(itemPtr->hitRate()) ) / float(CTickEventHandler::getGameTimeStep()) ); } Quality = (uint16)itemPtr->recommended();