UseDelay + ItemCooldown merge (#22502)
This commit is contained in:
@@ -79,8 +79,12 @@ namespace Content.Server.Chemistry.EntitySystems
|
||||
if (!EligibleEntity(target, _entMan, component))
|
||||
return false;
|
||||
|
||||
if (TryComp(uid, out UseDelayComponent? delayComp) && _useDelay.ActiveDelay(uid, delayComp))
|
||||
return false;
|
||||
if (TryComp(uid, out UseDelayComponent? delayComp))
|
||||
{
|
||||
if (_useDelay.IsDelayed((uid, delayComp)))
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
string? msgFormat = null;
|
||||
|
||||
@@ -117,8 +121,8 @@ namespace Content.Server.Chemistry.EntitySystems
|
||||
|
||||
// Medipens and such use this system and don't have a delay, requiring extra checks
|
||||
// BeginDelay function returns if item is already on delay
|
||||
if (delayComp is not null)
|
||||
_useDelay.BeginDelay(uid, delayComp);
|
||||
if (delayComp != null)
|
||||
_useDelay.TryResetDelay((uid, delayComp));
|
||||
|
||||
// Get transfer amount. May be smaller than component.TransferAmount if not enough room
|
||||
var realTransferAmount = FixedPoint2.Min(component.TransferAmount, targetSolution.AvailableVolume);
|
||||
|
||||
Reference in New Issue
Block a user