mirror of
https://github.com/ZDoom/gzdoom-gles.git
synced 2024-11-25 05:31:00 +00:00
- added a virtual 'used' method that gets called when the player presses use on an actor. This method will only be called if the actor does not have the USESPECIAL flag - that one will be handled as before.
This commit is contained in:
parent
c01289e999
commit
8d7a64bd17
2 changed files with 14 additions and 1 deletions
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
|
@ -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<Actor> GetReplacement(class<Actor> cls);
|
||||
native static class<Actor> GetReplacee(class<Actor> cls);
|
||||
|
|
Loading…
Reference in a new issue