diff --git a/src/kOS.Safe/Encapsulation/KOSDelegate.cs b/src/kOS.Safe/Encapsulation/KOSDelegate.cs index 7c65b1538..ab9f8bb71 100644 --- a/src/kOS.Safe/Encapsulation/KOSDelegate.cs +++ b/src/kOS.Safe/Encapsulation/KOSDelegate.cs @@ -62,7 +62,7 @@ public List GetMergedArgs(List args) return merged; } - public Structure CallPassingArgs(params Structure[] args) + public virtual Structure CallPassingArgs(params Structure[] args) { if (Cpu == null) throw new KOSCannotCallException(); diff --git a/src/kOS.Safe/Encapsulation/NoDelegate.cs b/src/kOS.Safe/Encapsulation/NoDelegate.cs index 585532cd7..ce6a92e13 100644 --- a/src/kOS.Safe/Encapsulation/NoDelegate.cs +++ b/src/kOS.Safe/Encapsulation/NoDelegate.cs @@ -1,16 +1,10 @@ -using System; -using System.Collections.Generic; using kOS.Safe.Execution; -using kOS.Safe.Exceptions; -using kOS.Safe.Compilation; namespace kOS.Safe.Encapsulation { /// - /// A UserDelegate that cannot actually ever executesany user code. - /// Instead, when OpcodeCall() is executed for it, it will merely - /// crash with an exception. The idea is to give scripts something - /// they can use to "unset" a callback hook. + /// A UserDelegate that cannot actually ever execute any user code. + /// The idea is to give scripts something they can use to "unset" a callback hook. /// [kOS.Safe.Utilities.KOSNomenclature("NoDelegate")] public class NoDelegate : UserDelegate @@ -32,15 +26,10 @@ public override KOSDelegate Clone() { return new NoDelegate(Cpu); } - - public override void PushUnderArgs() - { - // force it to do nothing. - } - - public override Structure CallWithArgsPushedAlready() + + public override Structure CallPassingArgs(params Structure[] args) { - throw new KOSCannotCallException(); + return new KOSPassThruReturn(); } public override string ToString()