Skip to content

Commit

Permalink
Added time to unbuckle the disabled (#1496)
Browse files Browse the repository at this point in the history
* Added time to unbuckle the disabled

* Fixed verison

* Wheelchair doafter fix

* silly me

---------

Co-authored-by: Dexler <[email protected]>
  • Loading branch information
Ady4ik and DexlerXD authored Aug 5, 2024
1 parent c0961cb commit 44293fb
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 1 deletion.
6 changes: 5 additions & 1 deletion Content.Shared/Buckle/SharedBuckleSystem.Buckle.cs
Original file line number Diff line number Diff line change
Expand Up @@ -446,10 +446,14 @@ public bool TryUnbuckle(Entity<BuckleComponent?> buckle, EntityUid? user, bool p
vehicle.Rider != user && !_mobState.IsIncapacitated(buckle))
{
//SS220-Vehicle-doafter-fix begin
var unbuckleTime = buckle.Comp.VehicleUnbuckleTime;

if (vehicle.UnbuckleTime != null)
unbuckleTime = vehicle.UnbuckleTime.Value;
//So here if the one to unbuckle isn't one riding the vehicle,
//we are raising DoAfter event, so you need some time to
//unbuckle someone from a vehicle.
var doAfterEventArgs = new DoAfterArgs(EntityManager, user.Value, buckle.Comp.VehicleUnbuckleTime, new UnbuckleDoAfterEvent(),
var doAfterEventArgs = new DoAfterArgs(EntityManager, user.Value, unbuckleTime, new UnbuckleDoAfterEvent(),
vehicle.Rider, target: vehicle.Rider)
{
BreakOnMove = true,
Expand Down
10 changes: 10 additions & 0 deletions Content.Shared/SS220/Vehicle/Components/VehicleComponent.cs
Original file line number Diff line number Diff line change
Expand Up @@ -111,4 +111,14 @@ public sealed partial class VehicleComponent : Component
[DataField("hideRider")]
[ViewVariables(VVAccess.ReadWrite)]
public bool HideRider;


// SS220 Wheelchair fix begin
/// <summary>
/// Time needed to unbuckle an entity from a vehicle. Overrides Buckle unbuckle time if not null.
/// </summary>
[DataField("unbuckleTime")]
[ViewVariables(VVAccess.ReadWrite)]
public TimeSpan? UnbuckleTime;
// SS220 Wheelchair fix end
}
Original file line number Diff line number Diff line change
Expand Up @@ -419,6 +419,7 @@
hasKey: true
northOverride: 0
southOverride: 0
unbuckleTime: 2 # SS220 wheelchair fix 04.08
- type: Sprite
sprite: Objects/Vehicles/wheelchair.rsi
layers:
Expand Down

0 comments on commit 44293fb

Please sign in to comment.