Skip to content

Commit e3ec0b6

Browse files
committed
Don't assume weapon has a slot.
1 parent 806619c commit e3ec0b6

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

NetActorController.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ private void Update()
9696
if (weaponWithName != null)
9797
{
9898
Plugin.logger.LogInfo($"Changing weapon to: {weaponWithName.name}. current weapon: {actor.activeWeapon?.name}");
99-
actor.EquipNewWeaponEntry(weaponWithName, actor.activeWeapon.slot, true);
99+
actor.EquipNewWeaponEntry(weaponWithName, actor.activeWeapon?.slot ?? 0, true);
100100
}
101101
}
102102

0 commit comments

Comments
 (0)