From 9252682c535030924f4b57d5ec802a4b7903d53b Mon Sep 17 00:00:00 2001 From: Marco Hladik Date: Sat, 26 Mar 2022 23:26:28 -0700 Subject: [PATCH] NSTrigger: Add 'Trigger' input, this will make interacting between GoldSrc and Source triggers easier. --- src/gs-entbase/shared/NSTrigger.h | 1 + src/gs-entbase/shared/NSTrigger.qc | 11 +++++++++++ 2 files changed, 12 insertions(+) diff --git a/src/gs-entbase/shared/NSTrigger.h b/src/gs-entbase/shared/NSTrigger.h index 8d7e21bf..8fea1019 100644 --- a/src/gs-entbase/shared/NSTrigger.h +++ b/src/gs-entbase/shared/NSTrigger.h @@ -52,6 +52,7 @@ class NSTrigger:NSIO /* overrides */ virtual void(float) Save; virtual void(string,string) Restore; + virtual void(entity, string, string) Input; #endif virtual void(string, string) SpawnKey; }; diff --git a/src/gs-entbase/shared/NSTrigger.qc b/src/gs-entbase/shared/NSTrigger.qc index b5ac10ed..86c51231 100644 --- a/src/gs-entbase/shared/NSTrigger.qc +++ b/src/gs-entbase/shared/NSTrigger.qc @@ -152,6 +152,17 @@ NSTrigger::Restore(string strKey, string strValue) super::Restore(strKey, strValue); } } +void +NSTrigger::Input(entity eAct, string strInput, string strData) +{ + switch (strInput) { + case "Trigger": + Trigger(eAct, TRIG_TOGGLE); + break; + default: + super:: Input(eAct, strInput, strData); + } +} #endif void