@@ -1079,14 +1079,20 @@ local function OnCreateMove(pCmd)
1079
1079
can_attack = false
1080
1080
can_charge = false
1081
1081
1082
- -- ===== Charge Reach State Machine =====
1083
- if chargeState == " aim" then
1084
- if chargeAimAngles then
1085
- engine .SetViewAngles (EulerAngles (chargeAimAngles .pitch , chargeAimAngles .yaw , 0 ))
1082
+ -- ===== Charge Reach State Machine (Demoman only) =====
1083
+ if pLocal and pLocal :GetPropInt (" m_iClass" ) == 4 then
1084
+ if chargeState == " aim" then
1085
+ if chargeAimAngles then
1086
+ engine .SetViewAngles (EulerAngles (chargeAimAngles .pitch , chargeAimAngles .yaw , 0 ))
1087
+ end
1088
+ chargeState = " charge" -- next tick will trigger charge
1089
+ elseif chargeState == " charge" then
1090
+ pCmd :SetButtons (pCmd :GetButtons () | IN_ATTACK2 )
1091
+ chargeState = " idle"
1092
+ chargeAimAngles = nil
1086
1093
end
1087
- chargeState = " charge" -- next tick will trigger charge
1088
- elseif chargeState == " charge" then
1089
- pCmd :SetButtons (pCmd :GetButtons () | IN_ATTACK2 )
1094
+ else
1095
+ -- Not Demoman: never drive charge reach state machine
1090
1096
chargeState = " idle"
1091
1097
chargeAimAngles = nil
1092
1098
end
@@ -1462,7 +1468,8 @@ local function OnCreateMove(pCmd)
1462
1468
aim_angles = aimpos
1463
1469
end
1464
1470
1465
- if Menu .Aimbot .ChargeBot and pLocal :InCond (17 ) and not can_attack then
1471
+ -- Charge-bot steering only relevant to Demoman shield charge (class 4)
1472
+ if Menu .Aimbot .ChargeBot and pLocalClass == 4 and pLocal :InCond (17 ) and not can_attack then
1466
1473
local trace = engine .TraceHull (pLocalOrigin , inRangePoint or vPlayerFuture , vHitbox [1 ], vHitbox [2 ],
1467
1474
MASK_PLAYERSOLID_BRUSHONLY )
1468
1475
if trace .fraction == 1 or trace .entity == CurrentTarget then
@@ -1477,7 +1484,7 @@ local function OnCreateMove(pCmd)
1477
1484
local limitedYaw = currentAng .yaw + Clamp (yawDiff , - MAX_CHARGE_BOT_TURN , MAX_CHARGE_BOT_TURN )
1478
1485
engine .SetViewAngles (EulerAngles (currentAng .pitch , limitedYaw , 0 ))
1479
1486
end
1480
- elseif Menu .Aimbot .ChargeBot and chargeLeft == 100 and input .IsButtonDown (MOUSE_RIGHT ) and not can_attack and fDistance < 750 then
1487
+ elseif Menu .Aimbot .ChargeBot and pLocalClass == 4 and chargeLeft == 100 and input .IsButtonDown (MOUSE_RIGHT ) and not can_attack and fDistance < 750 then
1481
1488
local trace = engine .TraceHull (pLocalFuture , inRangePoint or vPlayerFuture , vHitbox [1 ], vHitbox [2 ],
1482
1489
MASK_PLAYERSOLID_BRUSHONLY )
1483
1490
if trace .fraction == 1 or trace .entity == CurrentTarget then
0 commit comments