From 9408c8cc53b99585b1cfb3c4fbf0a1f4df438bd6 Mon Sep 17 00:00:00 2001 From: Alexander Pickering Date: Fri, 2 Nov 2018 16:10:02 -0400 Subject: Use pac3's new animation library api Pac3 modified it's animation library --- gamemode/core/animation/sh_animations.lua | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) (limited to 'gamemode/core/animation/sh_animations.lua') diff --git a/gamemode/core/animation/sh_animations.lua b/gamemode/core/animation/sh_animations.lua index a1430a5..e8c1f22 100644 --- a/gamemode/core/animation/sh_animations.lua +++ b/gamemode/core/animation/sh_animations.lua @@ -1,8 +1,10 @@ -if not RegisterLuaAnimation then +if CLIENT and not (pac and pac.animations and pac.animations.RegisterAnimation) then error("JetBoom's libanimbone is required for animations. (It's bundeled with PAC3)") return end +local anim = {} + local sequences local log = nrequire("log.lua") if SERVER then @@ -22,3 +24,15 @@ hook.Add("CalcMainActivity","art_swing",function(ply,vel) return -1, sequences[ply][2] end end) + +--Why not just call RegisterAnimation directly? +--While writing this gamemode, pac3 changed it's API, +--And it was a pain in the ass to change all the code +--that called RegisterAnimation(). +if CLIENT then + function anim.RegisterAnimation(name,tbl) + pac.animations.RegisterAnimation(name,tbl) + end +end + +return anim -- cgit v1.2.3-70-g09d2