aboutsummaryrefslogtreecommitdiffstats
path: root/code/weapon
diff options
context:
space:
mode:
authorLeonardo Bishop <me@leonardobishop.com>2023-07-28 22:06:03 +0100
committerLeonardo Bishop <me@leonardobishop.com>2023-07-28 22:06:03 +0100
commit1e5c6393a6b29eb00dbb8fb137d86647cb0c356b (patch)
tree95cbba0e7ade6bd97675480c2559c8e01f74a635 /code/weapon
parentf137095304f456b06229e4d17ee8249e974fceaf (diff)
Add TryUnstuck and death overlay
Diffstat (limited to 'code/weapon')
-rw-r--r--code/weapon/Weapon.cs2
1 files changed, 2 insertions, 0 deletions
diff --git a/code/weapon/Weapon.cs b/code/weapon/Weapon.cs
index 4519adc..6d6fc20 100644
--- a/code/weapon/Weapon.cs
+++ b/code/weapon/Weapon.cs
@@ -195,11 +195,13 @@ public partial class Weapon : AnimatedEntity
[ClientRpc]
public void CreateViewModel()
{
+ DestroyViewModel();
if ( ViewModelPath == null ) return;
var vm = new WeaponViewModel( this );
vm.Model = Model.Load( ViewModelPath );
vm.Owner = Owner;
+ vm.Parent = Game.LocalPawn;
ViewModelEntity = vm;
if (!string.IsNullOrEmpty(HandsModelPath))
{