@@ -53,6 +53,8 @@ function PuristWallrunningCheck(ply, mv, cmd, vel, eyeang, timemult, speedmult)
5353
5454 if not trout .Hit then return end
5555
56+ ply .WallRunTraceMat = trout .MatType
57+
5658 if SERVER then
5759 ply :EmitSound (" Bump.Concrete" )
5860 end
180182
181183function PuristWallrunningThink (ply , mv , cmd , wr , wrtimeremains )
182184
183- local mat = ply .WallRunTraceMat
184- local wallsound = FOOTSTEPS_MAT_TYPE_TO_STR [mat ] or " Concrete"
185-
186185 if wr == 4 then
187186 local ang = cmd :GetViewAngles ()
188187 ang .x = 0
@@ -252,6 +251,25 @@ function PuristWallrunningThink(ply, mv, cmd, wr, wrtimeremains)
252251 mv :SetForwardSpeed (0 )
253252 mv :SetSideSpeed (0 )
254253
254+ do
255+ local tr = ply .WallrunTrace
256+ local trout = ply .WallrunTraceOut
257+ local eyeang = ply :EyeAngles ()
258+ eyeang .x = 0
259+
260+ tr .start = ply :EyePos () - Vector (0 , 0 , 5 )
261+ tr .endpos = tr .start + eyeang :Forward () * 40
262+ tr .filter = ply
263+ tr .collisiongroup = COLLISION_GROUP_PLAYER_MOVEMENT
264+ tr .output = trout
265+
266+ util .TraceLine (tr )
267+
268+ if trout .Hit then
269+ ply .WallRunTraceMat = trout .MatType
270+ end
271+ end
272+
255273 if mv :KeyPressed (IN_JUMP ) and (mv :KeyDown (IN_MOVELEFT ) or mv :KeyDown (IN_MOVERIGHT )) then
256274 local dir = mv :KeyDown (IN_MOVERIGHT ) and 1 or - 1
257275 local vel = mv :GetVelocity ()
@@ -264,6 +282,7 @@ function PuristWallrunningThink(ply, mv, cmd, wr, wrtimeremains)
264282 ParkourEvent (event , ply )
265283
266284 if IsFirstTimePredicted () then
285+ local wallsound = FOOTSTEPS_MAT_TYPE_TO_STR [ply .WallRunTraceMat ] or " Concrete"
267286 ply :EmitSound (" Wallrun." .. wallsound )
268287 timer .Simple (0.025 , function ()
269288 ply :EmitSound (" WallrunRelease.Concrete" )
@@ -368,6 +387,7 @@ function PuristWallrunningThink(ply, mv, cmd, wr, wrtimeremains)
368387 ply :SetWallrunDir (trout .HitNormal )
369388 end
370389 end
390+
371391 ply .WallRunTraceMat = trout .MatType
372392
373393 if mv :KeyPressed (IN_JUMP ) and ply :GetWallrunTime () - CurTime () ~= hwrtime then
@@ -382,6 +402,7 @@ function PuristWallrunningThink(ply, mv, cmd, wr, wrtimeremains)
382402 ParkourEvent (event , ply )
383403
384404 if IsFirstTimePredicted () then
405+ local wallsound = FOOTSTEPS_MAT_TYPE_TO_STR [ply .WallRunTraceMat ] or " Concrete"
385406 ply :EmitSound (" Wallrun." .. wallsound )
386407 timer .Simple (0.025 , function ()
387408 ply :EmitSound (" WallrunRelease.Concrete" )
@@ -402,6 +423,7 @@ function PuristWallrunningThink(ply, mv, cmd, wr, wrtimeremains)
402423 end
403424
404425 if SERVER then
426+ local wallsound = FOOTSTEPS_MAT_TYPE_TO_STR [ply .WallRunTraceMat ] or " Concrete"
405427 ply :EmitSound (" Wallrun." .. wallsound )
406428 ply :EmitSound (" Cloth.MovementRun" )
407429
0 commit comments