Fix 1 vehicle exploit, increase price of ATV crate (#7761)

This commit is contained in:
Rane
2022-04-24 20:05:54 -04:00
committed by GitHub
parent 4b74a507c6
commit 7057293775
3 changed files with 10 additions and 4 deletions

View File

@@ -23,6 +23,7 @@ namespace Content.Server.Vehicle
[Dependency] private readonly SharedAmbientSoundSystem _ambientSound = default!;
[Dependency] private readonly TagSystem _tagSystem = default!;
[Dependency] private readonly ItemSlotsSystem _itemSlotsSystem = default!;
[Dependency] private readonly RiderSystem _riderSystem = default!;
public override void Initialize()
{
@@ -69,6 +70,12 @@ namespace Content.Server.Vehicle
{
if (args.Buckling)
{
/// Add a virtual item to rider's hand, unbuckle if we can't.
if (!_virtualItemSystem.TrySpawnVirtualItemInHand(uid, args.BuckledEntity))
{
_riderSystem.UnbuckleFromVehicle(args.BuckledEntity);
return;
}
/// Set up the rider and vehicle with each other
EnsureComp<SharedPlayerInputMoverComponent>(uid);
var rider = EnsureComp<RiderComponent>(args.BuckledEntity);
@@ -79,8 +86,7 @@ namespace Content.Server.Vehicle
/// Handle pulling
RemComp<SharedPullableComponent>(args.BuckledEntity);
RemComp<SharedPullableComponent>(uid);
/// Add a virtual item to rider's hand
_virtualItemSystem.TrySpawnVirtualItemInHand(uid, args.BuckledEntity);
/// Let this open doors if it has the key in it
if (component.HasKey)
{