Skip to content

Commit

Permalink
Weapons: Fixed crowbar attack animation not being visible to the loca…
Browse files Browse the repository at this point in the history
…l player (#1556)
  • Loading branch information
TW1STaL1CKY authored Jun 13, 2024
1 parent 30884c6 commit e471dfb
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,7 @@ All notable changes to TTT2 will be documented here. Inspired by [keep a changel
- Fixed a null entity error in the ShootBullet function in weapon_tttbase (by @mexikoedi)
- Fixed a nil compare error in the DrawHUD function in weapon_tttbasegrenade (by @mexikoedi)
- Fixed players sometimes not receiving their role if they joined late to the game (by @TimGoll)
- Fixed crowbar attack animation not being visible to the player swinging it (by @TW1STaL1CKY)
- Fixed weapon dryfire sound interrupting the weapon's gunshot sound (by @TW1STaL1CKY)
- Fixed incendiaries sometimes exploding without fire (by @TimGoll)
- Fixed scoreboard not showing any body search info on players that changed to forced spec during a round (by @TimGoll)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -166,6 +166,7 @@ function SWEP:PrimaryAttack()
local hitEnt = tr_main.Entity

self:EmitSound(sound_single)
owner:SetAnimation(PLAYER_ATTACK1)

if IsValid(hitEnt) or tr_main.HitWorld then
self:SendWeaponAnim(ACT_VM_HITCENTER)
Expand Down Expand Up @@ -216,8 +217,6 @@ function SWEP:PrimaryAttack()

local trEnt = tr_all.Entity

owner:SetAnimation(PLAYER_ATTACK1)

if IsValid(hitEnt) then
if self:OpenEnt(hitEnt) == OPEN_NO and IsValid(trEnt) then
self:OpenEnt(trEnt) -- See if there's a nodraw thing we should open
Expand Down Expand Up @@ -274,7 +273,6 @@ function SWEP:SecondaryAttack()
pushvel.z = math.Clamp(pushvel.z, 50, 100) -- limit the upward force to prevent launching

ply:SetVelocity(ply:GetVelocity() + pushvel)
owner:SetAnimation(PLAYER_ATTACK1)

ply.was_pushed = {
att = owner,
Expand All @@ -286,6 +284,8 @@ function SWEP:SecondaryAttack()

self:EmitSound(sound_single)
self:SendWeaponAnim(ACT_VM_HITCENTER)
owner:SetAnimation(PLAYER_ATTACK1)

self:SetNextSecondaryFire(CurTime() + self.Secondary.Delay)
end

Expand Down

0 comments on commit e471dfb

Please sign in to comment.