Skip to content

Commit

Permalink
Fixed movement speed effects for different players
Browse files Browse the repository at this point in the history
  • Loading branch information
Regynate authored Sep 21, 2023
1 parent 5331161 commit 516c44d
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions ChaosMod/Effects/db/Player/PlayerMovementSpeed.cpp
Original file line number Diff line number Diff line change
@@ -1,9 +1,13 @@
#include <stdafx.h>

static void Override(float value)
{
SET_PED_MOVE_RATE_OVERRIDE(PLAYER_PED_ID(), value);
}

static void OnTickx5()
{
static Ped plr = PLAYER_PED_ID();
SET_PED_MOVE_RATE_OVERRIDE(plr, 5.f);
Override(5.f);
}

// clang-format off
Expand All @@ -19,8 +23,7 @@ REGISTER_EFFECT(nullptr, nullptr, OnTickx5, EffectInfo

static void OnTickx10()
{
static Ped plr = PLAYER_PED_ID();
SET_PED_MOVE_RATE_OVERRIDE(plr, 5.f);
Override(10.f);
}

// clang-format off
Expand All @@ -36,8 +39,7 @@ REGISTER_EFFECT(nullptr, nullptr, OnTickx10, EffectInfo

static void OnTickx05()
{
static Ped plr = PLAYER_PED_ID();
SET_PED_MOVE_RATE_OVERRIDE(plr, 0.5f);
Override(0.5f);
}

// clang-format off
Expand Down

0 comments on commit 516c44d

Please sign in to comment.