mirror of
https://github.com/ZDoom/qzdoom.git
synced 2025-02-17 17:41:23 +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))
|
if (P_ActivateThingSpecial(in->d.thing, usething))
|
||||||
return true;
|
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;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -329,7 +329,12 @@ class Actor : Thinker native
|
||||||
{
|
{
|
||||||
return -1;
|
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> GetReplacement(class<Actor> cls);
|
||||||
native static class<Actor> GetReplacee(class<Actor> cls);
|
native static class<Actor> GetReplacee(class<Actor> cls);
|
||||||
|
|
Loading…
Reference in a new issue