Faction Test 100.13.0.0

This commit is contained in:
Markus Isberg
2023-01-11 15:36:23 +02:00
parent 1650735468
commit caa5a2f762
145 changed files with 2100 additions and 1111 deletions
@@ -75,13 +75,14 @@ namespace Barotrauma.Abilities
if (wt == WeaponType.Any || !weapontype.HasFlag(wt)) { continue; }
switch (wt)
{
// it is possible that an item that has both a melee and a projectile component will return true
// even when not used as a melee/ranged weapon respectively
// attackdata should contain data regarding whether the attack is melee or not
case WeaponType.Melee:
//if the item has an active projectile component (has been fired), don't consider it a melee weapon
if (item?.GetComponent<Projectile>() is { IsActive: true }) { continue; }
if (item?.GetComponent<MeleeWeapon>() != null) { return true; }
break;
case WeaponType.Ranged:
//if the item has a melee weapon component that's being used now, don't consider it a projectile
if (item?.GetComponent<MeleeWeapon>() is { Hitting: true }) { continue; }
if (item?.GetComponent<Projectile>() != null) { return true; }
break;
case WeaponType.HandheldRanged: