Fixed a rare case where float and double mixup would result in an incorrect speed
--HG-- branch : fix_speed
This commit is contained in:
parent
c3c4e56e4f
commit
1d960d91ff
1 changed files with 2 additions and 1 deletions
|
@ -130,7 +130,8 @@ CCombatWeapon::CCombatWeapon(CGameItemPtr itemPtr)
|
|||
// weapon hit rate is in hit/10s and we use ticks/hits....
|
||||
if (itemPtr->hitRate() != 0)
|
||||
{
|
||||
LatencyInTicks = uint16( (10.0f / itemPtr->hitRate()) / CTickEventHandler::getGameTimeStep());
|
||||
//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()) );
|
||||
}
|
||||
|
||||
Quality = (uint16)itemPtr->recommended();
|
||||
|
|
Loading…
Reference in a new issue