- added MF8_DONTFACETALKER flag which prevents NPCs from facing the player in conversations.

This commit is contained in:
Christoph Oelckers 2018-07-22 11:32:45 +02:00
parent 051521a898
commit 6d0b172762
3 changed files with 12 additions and 5 deletions

View file

@ -402,6 +402,7 @@ enum ActorFlag8
MF8_FRIGHTENING = 0x00000001, // for those moments when halloween just won't do
MF8_INSCROLLSEC = 0x00000002, // actor is partially inside a scrolling sector
MF8_BLOCKASPLAYER = 0x00000004, // actor is blocked by player-blocking lines even if not a player
MF8_DONTFACETALKER = 0x00000008, // don't alter the angle to face the player in conversations
};
// --- mobj.renderflags ---

View file

@ -813,6 +813,7 @@ void P_StartConversation (AActor *npc, AActor *pc, bool facetalker, bool saveang
npc->target = pc;
if (facetalker)
{
if (!(npc->flags8 & MF8_DONTFACETALKER))
A_FaceTarget (npc);
pc->Angles.Yaw = pc->AngleTo(npc);
}
@ -936,6 +937,7 @@ static void HandleReply(player_t *player, bool isconsole, int nodenum, int reply
if (reply == NULL)
{
// The default reply was selected
if (!(npc->flags8 & MF8_DONTFACETALKER))
npc->Angles.Yaw = player->ConversationNPCAngle;
npc->flags5 &= ~MF5_INCONVERSATION;
return;
@ -952,6 +954,7 @@ static void HandleReply(player_t *player, bool isconsole, int nodenum, int reply
TerminalResponse(reply->QuickNo);
}
npc->ConversationAnimation(2);
if (!(npc->flags8 & MF8_DONTFACETALKER))
npc->Angles.Yaw = player->ConversationNPCAngle;
npc->flags5 &= ~MF5_INCONVERSATION;
return;
@ -1080,6 +1083,7 @@ static void HandleReply(player_t *player, bool isconsole, int nodenum, int reply
}
}
if (!(npc->flags8 & MF8_DONTFACETALKER))
npc->Angles.Yaw = player->ConversationNPCAngle;
// [CW] Set these to NULL because we're not using to them
@ -1129,6 +1133,7 @@ void P_ConversationCommand (int netcode, int pnum, uint8_t **stream)
assert(netcode == DEM_CONVNULL || netcode == DEM_CONVCLOSE);
if (player->ConversationNPC != NULL)
{
if (!(player->ConversationNPC->flags8 & MF8_DONTFACETALKER))
player->ConversationNPC->Angles.Yaw = player->ConversationNPCAngle;
player->ConversationNPC->flags5 &= ~MF5_INCONVERSATION;
}

View file

@ -317,6 +317,7 @@ static FFlagDef ActorFlagDefs[]=
DEFINE_FLAG(MF8, FRIGHTENING, AActor, flags8),
DEFINE_FLAG(MF8, BLOCKASPLAYER, AActor, flags8),
DEFINE_FLAG(MF8, DONTFACETALKER, AActor, flags8),
// Effect flags
DEFINE_FLAG(FX, VISIBILITYPULSE, AActor, effects),