make freestyle zones also work for +use blocks

This commit is contained in:
shavitush 2016-06-20 20:09:39 +03:00
parent 4ede31f957
commit 7054795b4c

View File

@ -855,7 +855,15 @@ public Action OnPlayerRunCmd(int client, int &buttons, int &impulse, float vel[3
bool bOnGround = GetEntityFlags(client) & FL_ONGROUND || bOnLadder; bool bOnGround = GetEntityFlags(client) & FL_ONGROUND || bOnLadder;
// key blocking // key blocking
if(!Shavit_InsideZone(client, Zone_Freestyle) && !bOnGround) if(!Shavit_InsideZone(client, Zone_Freestyle))
{
// block E
if(gI_StyleProperties[gBS_Style[client]] & STYLE_BLOCK_USE && buttons & IN_USE)
{
buttons &= ~IN_USE;
}
if(!bOnGround)
{ {
if(gI_StyleProperties[gBS_Style[client]] & STYLE_BLOCK_W && (vel[0] > 0 || buttons & IN_FORWARD)) if(gI_StyleProperties[gBS_Style[client]] & STYLE_BLOCK_W && (vel[0] > 0 || buttons & IN_FORWARD))
{ {
@ -889,7 +897,7 @@ public Action OnPlayerRunCmd(int client, int &buttons, int &impulse, float vel[3
buttons &= ~IN_MOVERIGHT; buttons &= ~IN_MOVERIGHT;
} }
} }
}
if(Shavit_InsideZone(client, Zone_Start) && gCV_BlockPreJump.BoolValue && !(gI_StyleProperties[gBS_Style[client]] & STYLE_PRESPEED)) if(Shavit_InsideZone(client, Zone_Start) && gCV_BlockPreJump.BoolValue && !(gI_StyleProperties[gBS_Style[client]] & STYLE_PRESPEED))
{ {
@ -930,12 +938,6 @@ public Action OnPlayerRunCmd(int client, int &buttons, int &impulse, float vel[3
gB_OnGround[client] = false; gB_OnGround[client] = false;
} }
// block +use
if(gI_StyleProperties[gBS_Style[client]] & STYLE_BLOCK_USE && buttons & IN_USE)
{
buttons &= ~IN_USE;
}
if(gB_ClientPaused[client]) if(gB_ClientPaused[client])
{ {
vel = view_as<float>({0.0, 0.0, 0.0}); vel = view_as<float>({0.0, 0.0, 0.0});