Refactors throw events, makes cream pies ECS (#4500)

This commit is contained in:
Vera Aguilera Puerto
2021-08-21 09:18:23 +02:00
committed by GitHub
parent 140682f92b
commit ea4ce1c6fc
19 changed files with 287 additions and 260 deletions

View File

@@ -52,7 +52,7 @@ namespace Content.Server.Disposal.Unit.EntitySystems
SubscribeLocalEvent<DisposalUnitComponent, ComponentInit>(HandleDisposalInit);
SubscribeLocalEvent<DisposalUnitComponent, ComponentShutdown>(HandleDisposalShutdown);
SubscribeLocalEvent<DisposalUnitComponent, ThrowCollideEvent>(HandleThrowCollide);
SubscribeLocalEvent<DisposalUnitComponent, ThrowHitByEvent>(HandleThrowCollide);
// Interactions
SubscribeLocalEvent<DisposalUnitComponent, ActivateInWorldEvent>(HandleActivate);
@@ -144,7 +144,7 @@ namespace Content.Server.Disposal.Unit.EntitySystems
/// <summary>
/// Thrown items have a chance of bouncing off the unit and not going in.
/// </summary>
private void HandleThrowCollide(EntityUid uid, DisposalUnitComponent component, ThrowCollideEvent args)
private void HandleThrowCollide(EntityUid uid, DisposalUnitComponent component, ThrowHitByEvent args)
{
if (!CanInsert(component, args.Thrown) ||
_robustRandom.NextDouble() > 0.75 ||