Display item loadout HUD information while playing. Fix item drops bugging out at lower frame rates.

This commit is contained in:
2023-11-26 15:51:13 -06:00
parent 633c9355bc
commit 3605aa818d
9 changed files with 136 additions and 48 deletions
+3 -2
View File
@@ -100,11 +100,12 @@ void ItemDrop::UpdateDrops(float fElapsedTime){
float dist=lineTo.length();
if(dist<="ItemDrop.Item Drop Suction Range"_F){
vf2d pointVel=lineTo.vector().norm();
if((1.f/dist)*200*fElapsedTime>dist){
float moveDistance=(1.f/std::min(48.f,dist))*"ItemDrop.Item Drop Suction Strength"_F*fElapsedTime;
if(moveDistance>dist){
drop.pos=game->GetPlayer()->GetPos();
drop.collected=true;
}else{
drop.pos+=pointVel*(1.f/std::min(48.f,dist))*"ItemDrop.Item Drop Suction Strength"_F*fElapsedTime;
drop.pos+=pointVel*moveDistance;
}
}
}