Skip to content

Commit

Permalink
Merge pull request #477 from zer0k-z/replay-headfix
Browse files Browse the repository at this point in the history
Fix replay menu control compilation warning, fix player head getting inside the ceiling while ducked
  • Loading branch information
zealain authored Apr 19, 2024
2 parents e03f7cc + 95bf674 commit bb97fa7
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 3 deletions.
5 changes: 3 additions & 2 deletions addons/sourcemod/scripting/gokz-replays/controls.sp
Original file line number Diff line number Diff line change
Expand Up @@ -165,13 +165,13 @@ int MenuHandler_ReplayControls(Menu menu, MenuAction action, int param1, int par
{
if (!IsValidClient(param1))
{
return;
return 0;
}

int bot = GetBotFromClient(GetObserverTarget(param1));
if (bot == -1 || controllingPlayer[bot] != param1)
{
return;
return 0;
}

char info[16];
Expand Down Expand Up @@ -207,6 +207,7 @@ int MenuHandler_ReplayControls(Menu menu, MenuAction action, int param1, int par
delete menu;
}
}
return 0;
}

void CancelReplayControls(int client)
Expand Down
9 changes: 8 additions & 1 deletion addons/sourcemod/scripting/gokz-replays/playback.sp
Original file line number Diff line number Diff line change
Expand Up @@ -1005,7 +1005,7 @@ void PlaybackVersion2(int client, int bot, int &buttons, float vel[3], float ang
{
newButtons |= IN_JUMP;
}
if (currentTickData.flags & RP_IN_DUCK || currentTickData.flags & RP_FL_DUCKING)
if (currentTickData.flags & RP_IN_DUCK)
{
newButtons |= IN_DUCK;
}
Expand Down Expand Up @@ -1206,6 +1206,13 @@ void PlaybackVersion2Post(int client, int bot)
{
SetEntityFlags(client, entityFlags | FL_INWATER);
}
if (currentTickData.flags & RP_FL_DUCKING)
{
SetEntPropFloat(client, Prop_Send, "m_flDuckAmount", 1.0);
SetEntProp(client, Prop_Send, "m_bDucking", false);
SetEntProp(client, Prop_Send, "m_bDucked", true);
SetEntityFlags(client, FL_DUCKING);
}

botSpeed[bot] = GetVectorHorizontalLength(currentTickData.velocity);
playbackTick[bot]++;
Expand Down

0 comments on commit bb97fa7

Please sign in to comment.