diff --git a/src/p_map.cpp b/src/p_map.cpp index e46c441db..da84855fd 100644 --- a/src/p_map.cpp +++ b/src/p_map.cpp @@ -5287,6 +5287,14 @@ bool P_UseTraverse(AActor *usething, const DVector2 &start, const DVector2 &end, if (P_ActivateThingSpecial(in->d.thing, usething)) return true; } + IFVIRTUALPTR(usething, AActor, Used) + { + VMValue params[] = { usething, in->d.thing }; + int ret; + VMReturn vret(&ret); + GlobalVMStack.Call(func, params, 2, &vret, 1); + if (ret) return true; + } continue; } diff --git a/wadsrc/static/zscript/actor.txt b/wadsrc/static/zscript/actor.txt index ceda20bd8..5e2454ed2 100644 --- a/wadsrc/static/zscript/actor.txt +++ b/wadsrc/static/zscript/actor.txt @@ -329,7 +329,12 @@ class Actor : Thinker native { return -1; } - + + // Called when the player presses 'use' and an actor is found + virtual bool Used(Actor user) + { + return false; + } native static class GetReplacement(class cls); native static class GetReplacee(class cls);