Fix 1 vehicle exploit, increase price of ATV crate (#7761)
This commit is contained in:
@@ -46,7 +46,7 @@ namespace Content.Server.Vehicle
|
||||
}
|
||||
}
|
||||
|
||||
private void UnbuckleFromVehicle(EntityUid uid)
|
||||
public void UnbuckleFromVehicle(EntityUid uid)
|
||||
{
|
||||
if (!TryComp<BuckleComponent>(uid, out var buckle))
|
||||
return;
|
||||
|
||||
@@ -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)
|
||||
{
|
||||
|
||||
@@ -66,6 +66,6 @@
|
||||
sprite: Objects/Vehicles/atv.rsi
|
||||
state: vehicle
|
||||
product: CrateFunATV
|
||||
cost: 2500
|
||||
cost: 6000
|
||||
category: Fun
|
||||
group: market
|
||||
|
||||
Reference in New Issue
Block a user