Skip to content

Commit

Permalink
Merge pull request #589 from ProfessorBiddle/bounceboost
Browse files Browse the repository at this point in the history
ChaosMod: Make Bouncy Vehicles bouncier at low speeds
  • Loading branch information
pongo1231 authored Feb 18, 2021
2 parents d0f097a + ff599de commit 3596a60
Showing 1 changed file with 10 additions and 4 deletions.
14 changes: 10 additions & 4 deletions ChaosMod/Effects/db/Vehs/VehsBouncy.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,20 +6,26 @@

static void OnTick()
{
float velFactor;
for (auto veh : GetAllVehs())
{
SET_ENTITY_INVINCIBLE(veh, true);
//SET_VEHICLE_FIXED(veh);
if (HAS_ENTITY_COLLIDED_WITH_ANYTHING(veh))
{
Vector3 vel = GET_ENTITY_VELOCITY(veh);
APPLY_FORCE_TO_ENTITY(veh, 0, vel.x * -60.f, vel.y * -60.f, vel.z * -60.f, .0f, .0f, .0f, 0, true, true, true, false, true);
if ((vel.x < 10) && (vel.y < 10) && (vel.z < 10))
{
velFactor = 300.f;
}
else
{
velFactor = 60.f;
}
APPLY_FORCE_TO_ENTITY(veh, 0, vel.x * -velFactor, vel.y * -velFactor, vel.z * -velFactor, .0f, .0f, .0f, 0, true, true, true, false, true);

}
}



}
static void OnStop()
{
Expand Down

0 comments on commit 3596a60

Please sign in to comment.