Added trigger_sideduse from 2.30

This commit is contained in:
smallmodel 2024-04-10 21:44:03 +02:00
parent eea8c42268
commit d6870ecbee
No known key found for this signature in database
GPG key ID: 9F2D623CEDF08512
2 changed files with 33 additions and 1 deletions

View file

@ -457,7 +457,7 @@ void Trigger::TriggerStuff(Event *ev)
// if we setup an angle for this trigger, only trigger if other is within ~60 degrees of the triggers origin
// only test for this case if we were touched, activating or killed should never go through this code
//
if (useTriggerDir && (*ev == EV_Touch)) {
if (useTriggerDir && (*ev == EV_Touch || (*ev == EV_Use && isSubclassOf(TriggerSidedUse)))) {
Vector norm;
float dot;
@ -1951,6 +1951,27 @@ CLASS_DECLARATION(Trigger, TriggerUse, "trigger_use") {
TriggerUse::TriggerUse() {}
/*****************************************************************************/
/*QUAKED trigger_sideduse (1 0 0) ? x x NOT_PLAYERS MONSTERS
Activates targets when 'used' by an entity. It is usable only within specific degrees.
"setthread" name of thread to trigger. This can be in a different script file as well\
by using the '::' notation.
"triggerable" turn trigger on
"nottriggerable" turn trigger off
If NOT_PLAYERS is set, the trigger does not respond to players
If MONSTERS is set, the trigger will respond to monsters
******************************************************************************/
CLASS_DECLARATION(TriggerUse, TriggerSidedUse, "trigger_sideduse") {
{NULL, NULL}
};
TriggerSidedUse::TriggerSidedUse() {}
/*****************************************************************************/
/*QUAKED trigger_useonce (1 0 0) ? x x NOT_PLAYERS MONSTERS

View file

@ -401,6 +401,17 @@ public:
TriggerUse();
};
//
// Added in 2.30
// Can only be triggered if within specific degrees
class TriggerSidedUse : public TriggerUse
{
public:
CLASS_PROTOTYPE(TriggerSidedUse);
TriggerSidedUse();
};
class TriggerUseOnce : public TriggerUse
{
public: