Some manual TryGetComponent inlines

This commit is contained in:
Vera Aguilera Puerto
2021-12-03 12:51:44 +01:00
parent 0feebbff00
commit f3edecf994
10 changed files with 22 additions and 15 deletions

View File

@@ -189,7 +189,10 @@ namespace Content.Server.Weapon.Ranged.Barrels.Components
Dirty();
}
return chamberEntity?.GetComponentOrNull<AmmoComponent>()?.TakeBullet(spawnAt);
if (chamberEntity == null)
return null;
return chamberEntity.GetComponentOrNull<AmmoComponent>()?.TakeBullet(spawnAt);
}
protected override bool WeaponCanFire()