@@ -262,6 +262,7 @@ local stepSize = 18
262
262
local attackStarted = false
263
263
local attackTickCount = 0
264
264
local lastChargeTime = 0
265
+ local chargeAimAngles = nil -- yaw/pitch to look at when triggering charge reach exploit
265
266
266
267
-- Track the tick index of the last +attack press (user or script)
267
268
local lastAttackTick = - 1000 -- initialize far in the past
@@ -1515,6 +1516,12 @@ local function OnCreateMove(pCmd)
1515
1516
if pLocalClass == 4 and Menu .Misc .ChargeReach and chargeLeft == 100 and not attackStarted then
1516
1517
attackStarted = true
1517
1518
attackTickCount = 0
1519
+ -- Store aim direction to target future position so charge travels correctly
1520
+ if InRangePoint then
1521
+ chargeAimAngles = Math .PositionAngles (pLocalOrigin , InRangePoint )
1522
+ else
1523
+ chargeAimAngles = Math .PositionAngles (pLocalOrigin , vPlayerFuture )
1524
+ end
1518
1525
end
1519
1526
1520
1527
can_attack = false
@@ -1533,12 +1540,20 @@ local function OnCreateMove(pCmd)
1533
1540
-- Execute charge exactly at the end of the swing animation (1 tick before the hit registers)
1534
1541
if attackTickCount >= (weaponSmackDelay - 2 ) then
1535
1542
-- client.ChatPrintf("[Debug] Executing charge at end of swing, tick: " .. attackTickCount)
1543
+ -- Ensure we are facing stored aim direction before initiating charge
1544
+ if chargeAimAngles then
1545
+ -- Apply instantly so movement vector aligns with shield charge
1546
+ engine .SetViewAngles (EulerAngles (chargeAimAngles .pitch , chargeAimAngles .yaw , 0 ))
1547
+ pCmd :SetViewAngles (chargeAimAngles .pitch , chargeAimAngles .yaw , 0 )
1548
+ end
1549
+
1536
1550
pCmd :SetButtons (pCmd :GetButtons () | IN_ATTACK2 ) -- charge
1537
1551
1538
1552
-- Reset attack tracking
1539
1553
attackStarted = false
1540
1554
attackTickCount = 0
1541
1555
can_charge = false
1556
+ chargeAimAngles = nil
1542
1557
end
1543
1558
end
1544
1559
0 commit comments