Skip to content

Commit 90a9f54

Browse files
author
nitrocaster
committed
Fix bullet manager time factor rounding.
1 parent a62e83a commit 90a9f54

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

src/xrGame/Level_Bullet_Manager.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -248,7 +248,7 @@ void CBulletManager::UpdateWorkload()
248248
BulletVec::reverse_iterator i = m_Bullets.rbegin();
249249
BulletVec::reverse_iterator e = m_Bullets.rend();
250250
for (u16 j=u16(e - i); i != e; ++i, --j) {
251-
if ( process_bullet( rq_storage, *i, u32(time_delta*g_bullet_time_factor)) )
251+
if ( process_bullet( rq_storage, *i, time_delta*g_bullet_time_factor) )
252252
continue;
253253

254254
VERIFY (j > 0);
@@ -822,9 +822,9 @@ static bool try_update_bullet (SBullet& bullet, Fvector const& gravity, float
822822
}
823823

824824

825-
bool CBulletManager::process_bullet (collide::rq_results & storage, SBullet& bullet, u32 const delta_time)
825+
bool CBulletManager::process_bullet (collide::rq_results & storage, SBullet& bullet, float delta_time)
826826
{
827-
float const time_delta = float(delta_time)/1000.f;
827+
float const time_delta = delta_time / 1000.f;
828828
Fvector const gravity = Fvector().set( 0.f, -m_fGravityConst, 0.f);
829829

830830
float const air_resistance = (GameID() == eGameIDSingle) ? m_fAirResistanceK : bullet.air_resistance;

src/xrGame/Level_Bullet_Manager.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -218,7 +218,7 @@ class CBulletManager
218218
bool process_bullet (
219219
collide::rq_results& rq_storage,
220220
SBullet& bullet,
221-
u32 delta_time
221+
float delta_time
222222
);
223223
void __stdcall UpdateWorkload ();
224224
public:

0 commit comments

Comments
 (0)