mirror of
https://port.numenaute.org/aleajactaest/khanat-opennel-code.git
synced 2024-12-26 19:00:53 +00:00
Use speed as an int instead of float to calculate latency
This commit is contained in:
parent
480218b4c8
commit
0cfefb65f7
1 changed files with 1 additions and 1 deletions
|
@ -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();
|
||||
|
|
Loading…
Reference in a new issue