Merge branch 'master-upstream' into expl_int_analyzer
# Conflicts: # Content.Server/GameObjects/Components/Body/Part/BodyPartComponent.cs # Content.Server/GameObjects/Components/Botany/PlantHolderComponent.cs # Content.Server/GameObjects/Components/Chemistry/PillComponent.cs # Content.Server/GameObjects/Components/Interactable/TilePryingComponent.cs # Content.Server/GameObjects/Components/Items/FloorTileItemComponent.cs # Content.Server/GameObjects/Components/Items/RCD/RCDAmmoComponent.cs # Content.Server/GameObjects/Components/Items/RCD/RCDComponent.cs # Content.Server/GameObjects/Components/Medical/HealingComponent.cs # Content.Server/GameObjects/Components/Power/WirePlacerComponent.cs # Content.Shared/Chemistry/Solution.cs
This commit is contained in:
@@ -32,17 +32,17 @@ namespace Content.Server.GameObjects.Components.Items.RCD
|
||||
message.AddMarkup(Loc.GetString("It holds {0} charges.", refillAmmo));
|
||||
}
|
||||
|
||||
async Task IAfterInteract.AfterInteract(AfterInteractEventArgs eventArgs)
|
||||
async Task<bool> IAfterInteract.AfterInteract(AfterInteractEventArgs eventArgs)
|
||||
{
|
||||
if (eventArgs.Target == null || !eventArgs.Target.TryGetComponent(out RCDComponent rcdComponent) || !eventArgs.User.TryGetComponent(out IHandsComponent hands))
|
||||
{
|
||||
return;
|
||||
return false;
|
||||
}
|
||||
|
||||
if (rcdComponent.maxAmmo - rcdComponent._ammo < refillAmmo)
|
||||
{
|
||||
rcdComponent.Owner.PopupMessage(eventArgs.User, Loc.GetString("The RCD is full!"));
|
||||
return;
|
||||
return true;
|
||||
}
|
||||
|
||||
rcdComponent._ammo = Math.Min(rcdComponent.maxAmmo, rcdComponent._ammo + refillAmmo);
|
||||
@@ -51,6 +51,7 @@ namespace Content.Server.GameObjects.Components.Items.RCD
|
||||
//Deleting a held item causes a lot of errors
|
||||
hands.Drop(Owner, false);
|
||||
Owner.Delete();
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -93,7 +93,7 @@ namespace Content.Server.GameObjects.Components.Items.RCD
|
||||
message.AddMarkup(Loc.GetString("It's currently on {0} mode, and holds {1} charges.",_mode.ToString(), _ammo));
|
||||
}
|
||||
|
||||
async Task IAfterInteract.AfterInteract(AfterInteractEventArgs eventArgs)
|
||||
async Task<bool> IAfterInteract.AfterInteract(AfterInteractEventArgs eventArgs)
|
||||
{
|
||||
//No changing mode mid-RCD
|
||||
var startingMode = _mode;
|
||||
@@ -115,7 +115,7 @@ namespace Content.Server.GameObjects.Components.Items.RCD
|
||||
var result = await doAfterSystem.DoAfter(doAfterEventArgs);
|
||||
if (result == DoAfterStatus.Cancelled)
|
||||
{
|
||||
return;
|
||||
return true;
|
||||
}
|
||||
|
||||
switch (_mode)
|
||||
@@ -145,12 +145,12 @@ namespace Content.Server.GameObjects.Components.Items.RCD
|
||||
airlock.Transform.LocalRotation = Owner.Transform.LocalRotation; //Now apply icon smoothing.
|
||||
break;
|
||||
default:
|
||||
return; //I don't know why this would happen, but sure I guess. Get out of here invalid state!
|
||||
return true; //I don't know why this would happen, but sure I guess. Get out of here invalid state!
|
||||
}
|
||||
|
||||
_entitySystemManager.GetEntitySystem<AudioSystem>().PlayFromEntity("/Audio/Items/deconstruct.ogg", Owner);
|
||||
_ammo--;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
private bool IsRCDStillValid(AfterInteractEventArgs eventArgs, IMapGrid mapGrid, TileRef tile, Vector2i snapPos, RcdMode startingMode)
|
||||
|
||||
Reference in New Issue
Block a user