mirror of
https://github.com/ZDoom/gzdoom.git
synced 2025-03-13 22:42:07 +00:00
Added HasConversation
This commit is contained in:
parent
92dbdd3f39
commit
9e3db4f147
2 changed files with 15 additions and 2 deletions
|
@ -5707,7 +5707,7 @@ void R_OffsetView(FRenderViewpoint& viewPoint, const DVector3& dir, const double
|
|||
|
||||
static int CanTalk(AActor *self)
|
||||
{
|
||||
return self->Conversation != nullptr;
|
||||
return self->Conversation != nullptr && self->health > 0 && !(self->flags4 & MF4_INCOMBAT);
|
||||
}
|
||||
|
||||
DEFINE_ACTION_FUNCTION_NATIVE(AActor, CanTalk, CanTalk)
|
||||
|
@ -5716,10 +5716,22 @@ DEFINE_ACTION_FUNCTION_NATIVE(AActor, CanTalk, CanTalk)
|
|||
ACTION_RETURN_BOOL(CanTalk(self));
|
||||
}
|
||||
|
||||
static int HasConversation(AActor *self)
|
||||
{
|
||||
return self->Conversation != nullptr;
|
||||
}
|
||||
|
||||
DEFINE_ACTION_FUNCTION_NATIVE(AActor, HasConversation, HasConversation)
|
||||
{
|
||||
PARAM_SELF_PROLOGUE(AActor);
|
||||
ACTION_RETURN_BOOL(HasConversation(self));
|
||||
}
|
||||
|
||||
static int NativeStartConversation(AActor *self, AActor *player, bool faceTalker, bool saveAngle)
|
||||
{
|
||||
if (self->health <= 0 || (self->flags4 & MF4_INCOMBAT) || self->Conversation == nullptr)
|
||||
if (!CanTalk(self))
|
||||
return false;
|
||||
|
||||
self->ConversationAnimation(0);
|
||||
P_StartConversation(self, player, faceTalker, saveAngle);
|
||||
return true;
|
||||
|
|
|
@ -699,6 +699,7 @@ class Actor : Thinker native
|
|||
native clearscope int GetRenderStyle() const;
|
||||
native clearscope bool CheckKeys(int locknum, bool remote, bool quiet = false);
|
||||
protected native void CheckPortalTransition(bool linked = true);
|
||||
native clearscope bool HasConversation() const;
|
||||
native clearscope bool CanTalk() const;
|
||||
native bool StartConversation(Actor player, bool faceTalker = true, bool saveAngle = true);
|
||||
|
||||
|
|
Loading…
Reference in a new issue