Toy Box filled with toys (ready for merge) (#16252)

This commit is contained in:
brainfood1183
2023-06-03 04:31:47 +01:00
committed by GitHub
parent 3d29ab3486
commit c99585c94f
75 changed files with 1118 additions and 13 deletions

View File

@@ -106,13 +106,15 @@ public abstract partial class SharedVehicleSystem : EntitySystem
// Add Rider
if (args.Buckling)
{
// Add a virtual item to rider's hand, unbuckle if we can't.
if (!_virtualItemSystem.TrySpawnVirtualItemInHand(uid, args.BuckledEntity))
if (component.UseHand == true)
{
_buckle.TryUnbuckle(uid, uid, true);
return;
// Add a virtual item to rider's hand, unbuckle if we can't.
if (!_virtualItemSystem.TrySpawnVirtualItemInHand(uid, args.BuckledEntity))
{
_buckle.TryUnbuckle(uid, uid, true);
return;
}
}
// Set up the rider and vehicle with each other
EnsureComp<InputMoverComponent>(uid);
var rider = EnsureComp<RiderComponent>(args.BuckledEntity);
@@ -148,7 +150,9 @@ public abstract partial class SharedVehicleSystem : EntitySystem
// Clean up actions and virtual items
_actionsSystem.RemoveProvidedActions(args.BuckledEntity, uid);
_virtualItemSystem.DeleteInHandsMatching(args.BuckledEntity, uid);
if (component.UseHand == true)
_virtualItemSystem.DeleteInHandsMatching(args.BuckledEntity, uid);
// Entity is no longer riding