[Feat] Система лежания и снаряды теперь проходят через лежащих людей, если не целиться в них (#195)
* add: система лежания и вставания * add: теперь по-умолчанию по лежачим не попадают снаряды * add: только гуманоиды могут ложиться
This commit is contained in:
@@ -42,9 +42,19 @@ public sealed class ProjectileSystem : SharedProjectileSystem
|
||||
// This is so entities that shouldn't get a collision are ignored.
|
||||
if (args.OurFixtureId != ProjectileFixture || !args.OtherFixture.Hard
|
||||
|| component.DamagedEntity || component is { Weapon: null, OnlyCollideWhenShot: true })
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
var target = args.OtherEntity;
|
||||
|
||||
var collideAttemptEv = new ProjectileCollideAttemptEvent(uid, component, false);
|
||||
RaiseLocalEvent(target, ref collideAttemptEv);
|
||||
if (collideAttemptEv.Cancelled)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
// it's here so this check is only done once before possible hit
|
||||
var attemptEv = new ProjectileReflectAttemptEvent(uid, component, false);
|
||||
RaiseLocalEvent(target, ref attemptEv);
|
||||
|
||||
Reference in New Issue
Block a user