From cb24ecbbd6e68e1992b795683fcae5db22984135 Mon Sep 17 00:00:00 2001 From: YuRaNnNzZZ Date: Wed, 2 Aug 2023 22:51:36 +0300 Subject: [PATCH] undo vmanip hooks removal + add vmlegs check --- README.md | 1 - .../entities/entities/br_rabbitfrog/shared.lua | 3 +++ .../beatrun/entities/weapons/aewep_357.lua | 14 ++++++++++++++ .../entities/weapons/runnerhands/shared.lua | 4 ++++ .../gamemodes/beatrun/gamemode/sh/Quickturn.lua | 8 ++++++-- beatrun/gamemodes/beatrun/gamemode/sh/Sliding.lua | 4 ++++ 6 files changed, 31 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 91908f4..b852239 100644 --- a/README.md +++ b/README.md @@ -8,7 +8,6 @@ You can use *Beatrun Animations Installer* if you want to change your animations Installer source can be found [here](/BeatrunAnimInstaller/) # Installation -> Beatrun shouldn't conflict with Workshop VManip, but if it does, delete or disable it.
1. **Delete `beatrun` folder in *addons* if you have one!** 2. Extract `beatrun` folder to *your_game_folder/garrysmod/addons*. 3. Extract `lua` folder to *your_game_folder/garrysmod*. diff --git a/beatrun/gamemodes/beatrun/entities/entities/br_rabbitfrog/shared.lua b/beatrun/gamemodes/beatrun/entities/entities/br_rabbitfrog/shared.lua index 994bf56..2617232 100644 --- a/beatrun/gamemodes/beatrun/entities/entities/br_rabbitfrog/shared.lua +++ b/beatrun/gamemodes/beatrun/entities/entities/br_rabbitfrog/shared.lua @@ -202,6 +202,9 @@ local function RabbitCalcView(ply, origin, ang) neweye = true ply:CLViewPunch(Angle(12, 0, 0)) + if VManip then + VManip:PlayAnim("vault") + end end origin:Set(LerpVector(endlerp, lastpos, origin)) diff --git a/beatrun/gamemodes/beatrun/entities/weapons/aewep_357.lua b/beatrun/gamemodes/beatrun/entities/weapons/aewep_357.lua index 0df3cb2..f46e3db 100644 --- a/beatrun/gamemodes/beatrun/entities/weapons/aewep_357.lua +++ b/beatrun/gamemodes/beatrun/entities/weapons/aewep_357.lua @@ -355,6 +355,20 @@ hook.Add("PreDrawTranslucentRenderables", "ae", function() end end) +hook.Add("VManipVMEntity", "ae", function() + local ply = LocalPlayer() + local activewep = ply:GetActiveWeapon() + + if activewep.CLVM then return activewep.CLVM end +end) + +hook.Add("VManipLegsVMEntity", "ae", function() + local ply = LocalPlayer() + local activewep = ply:GetActiveWeapon() + + if activewep.CLVM then return activewep.CLVM end +end) + function SWEP:PrimaryAttack() if self:Clip1() < 1 then self:DryFire() diff --git a/beatrun/gamemodes/beatrun/entities/weapons/runnerhands/shared.lua b/beatrun/gamemodes/beatrun/entities/weapons/runnerhands/shared.lua index 296ba4e..01cab51 100644 --- a/beatrun/gamemodes/beatrun/entities/weapons/runnerhands/shared.lua +++ b/beatrun/gamemodes/beatrun/entities/weapons/runnerhands/shared.lua @@ -10,6 +10,10 @@ if CLIENT then SWEP.SlotPos = 1 SWEP.DrawAmmo = false SWEP.DrawCrosshair = false + + hook.Add("VManipPrePlayAnim", "LOCNoVManip", function() + if LocalPlayer():GetActiveWeapon():GetClass() == "runnerhands" or blinded then return false end + end) end SWEP.Author = "" diff --git a/beatrun/gamemodes/beatrun/gamemode/sh/Quickturn.lua b/beatrun/gamemodes/beatrun/gamemode/sh/Quickturn.lua index f889a0e..b8fb59f 100644 --- a/beatrun/gamemodes/beatrun/gamemode/sh/Quickturn.lua +++ b/beatrun/gamemodes/beatrun/gamemode/sh/Quickturn.lua @@ -5,7 +5,9 @@ end function DoJumpTurn(lookbehind) if not LocalPlayer():Alive() then return end - VMLegs:Remove() + if VMLegs and VMLegs:IsActive() then + VMLegs:Remove() + end BodyAnim:SetSequence("jumpturnfly") BodyAnimCycle = 0 @@ -30,7 +32,9 @@ end function DoJumpTurnStand() if not LocalPlayer():Alive() then return end - VMLegs:Remove() + if VMLegs and VMLegs:IsActive() then + VMLegs:Remove() + end local activewep = LocalPlayer():GetActiveWeapon() diff --git a/beatrun/gamemodes/beatrun/gamemode/sh/Sliding.lua b/beatrun/gamemodes/beatrun/gamemode/sh/Sliding.lua index d6dd1ff..86facac 100644 --- a/beatrun/gamemodes/beatrun/gamemode/sh/Sliding.lua +++ b/beatrun/gamemodes/beatrun/gamemode/sh/Sliding.lua @@ -88,6 +88,10 @@ local function SlidingAnimStart() BodyLimitY = 80 BodyLimitX = 40 + if VMLegs and VMLegs:IsActive() then + VMLegs:Remove() + end + if game.SinglePlayer() and not net.ReadBool() or not game.SinglePlayer() and not ply.DiveSliding then CamIgnoreAng = false camjoint = ply:GetSlidingSlippery() and "eyes" or "CameraJoint"