diff --git a/src/events.cpp b/src/events.cpp index 5be54044fb1..e76fb941150 100755 --- a/src/events.cpp +++ b/src/events.cpp @@ -686,6 +686,21 @@ DEFINE_ACTION_FUNCTION(DEventHandler, SendNetworkEvent) ACTION_RETURN_BOOL(currentVMLevel->localEventManager->SendNetworkEvent(name, arg1, arg2, arg3, false)); } +DEFINE_ACTION_FUNCTION(DEventHandler, SendConsoleEvent) +{ + PARAM_PROLOGUE; + PARAM_INT(playerNum); + PARAM_STRING(name); + PARAM_INT(arg1); + PARAM_INT(arg2); + PARAM_INT(arg3); + + if (playerNum == consoleplayer) + primaryLevel->localEventManager->Console(-1, name, arg1, arg2, arg3, false); + + return 0; +} + DEFINE_ACTION_FUNCTION(DEventHandler, Find) { PARAM_PROLOGUE; diff --git a/wadsrc/static/zscript/events.zs b/wadsrc/static/zscript/events.zs index 7492ea2b00c..658ec06c062 100644 --- a/wadsrc/static/zscript/events.zs +++ b/wadsrc/static/zscript/events.zs @@ -148,4 +148,5 @@ class EventHandler : StaticEventHandler native version("2.4") { clearscope static native StaticEventHandler Find(class type); clearscope static native void SendNetworkEvent(String name, int arg1 = 0, int arg2 = 0, int arg3 = 0); + clearscope static native void SendConsoleEvent(int playerNum, string name, int arg1 = 0, int arg2 = 0, int arg3 = 0); }