Added ScriptRemove

This commit is contained in:
smallmodel 2023-10-30 22:03:37 +01:00
parent 3ecb5bd06a
commit 5824022745
No known key found for this signature in database
GPG key ID: 9F2D623CEDF08512
2 changed files with 17 additions and 6 deletions

View file

@ -349,9 +349,9 @@ Event EV_Listener_WaitTillAnyTimeout
CLASS_DECLARATION(Class, Listener, NULL) {
{&EV_Listener_CommandDelay, &Listener::CommandDelay },
{&EV_Delete, &Listener::EventDelete },
{&EV_Remove, &Listener::EventDelete },
{&EV_ScriptRemove, &Listener::EventDelete },
{&EV_Remove, &Listener::Remove },
{&EV_Delete, &Listener::ScriptRemove },
{&EV_ScriptRemove, &Listener::ScriptRemove },
{&EV_Listener_Classname, &Listener::GetClassname },
{&EV_Listener_InheritsFrom, &Listener::EventInheritsFrom },
{&EV_Listener_IsInheritedBy, &Listener::EventIsInheritedBy },
@ -3734,10 +3734,10 @@ qboolean Listener::ValidEvent(str name) const
/*
=======================
EventDelete
Remove
=======================
*/
void Listener::EventDelete(Event *ev)
void Listener::Remove(Event *ev)
{
if (ev->NumArgs()) {
ScriptError("Arguments not allowed.");
@ -3746,6 +3746,16 @@ void Listener::EventDelete(Event *ev)
delete this;
}
/*
=======================
ScriptRemove
=======================
*/
void Listener::ScriptRemove(Event *ev)
{
PostEvent(EV_Remove, 0);
}
/*
=======================
EventInheritsFrom

View file

@ -577,7 +577,8 @@ public:
// Scripting functions
//
void CommandDelay(Event *ev);
void EventDelete(Event *ev);
void Remove(Event *ev);
void ScriptRemove(Event *ev);
void EventInheritsFrom(Event *ev);
void EventIsInheritedBy(Event *ev);
void GetClassname(Event *ev);