mirror of
https://github.com/ZDoom/gzdoom.git
synced 2024-11-22 12:11:25 +00:00
Adds "OnGiveSecret" virtual function on Actor for customizing behavior of secret finding.
This commit is contained in:
parent
674b6ee85c
commit
477cf23fd2
2 changed files with 13 additions and 1 deletions
|
@ -589,7 +589,15 @@ void P_GiveSecret(AActor *actor, bool printmessage, bool playsound, int sectornu
|
|||
{
|
||||
actor->player->secretcount++;
|
||||
}
|
||||
if (cl_showsecretmessage && actor->CheckLocalView(consoleplayer))
|
||||
int retval = 1;
|
||||
IFVIRTUALPTR(actor, AActor, OnGiveSecret)
|
||||
{
|
||||
VMValue params[] = { actor, printmessage, playsound };
|
||||
VMReturn ret;
|
||||
ret.IntAt(&retval);
|
||||
VMCall(func, params, countof(params), &ret, 1);
|
||||
}
|
||||
if (retval && cl_showsecretmessage && actor->CheckLocalView(consoleplayer))
|
||||
{
|
||||
if (printmessage)
|
||||
{
|
||||
|
@ -616,6 +624,7 @@ DEFINE_ACTION_FUNCTION(AActor, GiveSecret)
|
|||
return 0;
|
||||
}
|
||||
|
||||
|
||||
DEFINE_ACTION_FUNCTION(FLevelLocals, GiveSecret)
|
||||
{
|
||||
PARAM_PROLOGUE;
|
||||
|
|
|
@ -539,6 +539,9 @@ class Actor : Thinker native
|
|||
{
|
||||
return damage;
|
||||
}
|
||||
|
||||
// called on getting a secret, return false to disable default "secret found" message/sound
|
||||
virtual bool OnGiveSecret(bool printmsg, bool playsound);
|
||||
|
||||
native virtual bool OkayToSwitchTarget(Actor other);
|
||||
native static class<Actor> GetReplacement(class<Actor> cls);
|
||||
|
|
Loading…
Reference in a new issue