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

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),