mirror of
https://github.com/ZDoom/gzdoom.git
synced 2024-11-22 20:21:26 +00:00
Fix player not being able to talk to a Strife NPC during netplay, if another player talked to that NPC first. (#1312)
The ConversationNPC and ConversationPC fields were not cleared if the conversation was closed by selecting the goodbye option, or if the conversation was closed from the item checks. https://forum.zdoom.org/viewtopic.php?f=2&t=53655
This commit is contained in:
parent
1cf0b18897
commit
21ea68d552
1 changed files with 20 additions and 8 deletions
|
@ -151,6 +151,22 @@ int FLevelLocals::FindNode (const FStrifeDialogueNode *node)
|
|||
return rootnode;
|
||||
}
|
||||
|
||||
//============================================================================
|
||||
//
|
||||
// ClearConversationStuff
|
||||
//
|
||||
// Clear the conversation pointers on the player
|
||||
//
|
||||
//============================================================================
|
||||
|
||||
static void ClearConversationStuff(player_t* player)
|
||||
{
|
||||
player->ConversationFaceTalker = false;
|
||||
player->ConversationNPC = nullptr;
|
||||
player->ConversationPC = nullptr;
|
||||
player->ConversationNPCAngle = 0.;
|
||||
}
|
||||
|
||||
//============================================================================
|
||||
//
|
||||
// CheckStrifeItem
|
||||
|
@ -471,6 +487,7 @@ static void HandleReply(player_t *player, bool isconsole, int nodenum, int reply
|
|||
if (!(npc->flags8 & MF8_DONTFACETALKER))
|
||||
npc->Angles.Yaw = player->ConversationNPCAngle;
|
||||
npc->flags5 &= ~MF5_INCONVERSATION;
|
||||
if (gameaction != ga_slideshow) ClearConversationStuff(player);
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -488,6 +505,7 @@ static void HandleReply(player_t *player, bool isconsole, int nodenum, int reply
|
|||
if (!(npc->flags8 & MF8_DONTFACETALKER))
|
||||
npc->Angles.Yaw = player->ConversationNPCAngle;
|
||||
npc->flags5 &= ~MF5_INCONVERSATION;
|
||||
if (gameaction != ga_slideshow) ClearConversationStuff(player);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
@ -626,10 +644,7 @@ static void HandleReply(player_t *player, bool isconsole, int nodenum, int reply
|
|||
if (gameaction != ga_slideshow)
|
||||
{
|
||||
npc->flags5 &= ~MF5_INCONVERSATION;
|
||||
player->ConversationFaceTalker = false;
|
||||
player->ConversationNPC = nullptr;
|
||||
player->ConversationPC = nullptr;
|
||||
player->ConversationNPCAngle = 0.;
|
||||
ClearConversationStuff(player);
|
||||
}
|
||||
|
||||
if (isconsole)
|
||||
|
@ -673,10 +688,7 @@ void P_ConversationCommand (int netcode, int pnum, uint8_t **stream)
|
|||
}
|
||||
if (netcode == DEM_CONVNULL)
|
||||
{
|
||||
player->ConversationFaceTalker = false;
|
||||
player->ConversationNPC = nullptr;
|
||||
player->ConversationPC = nullptr;
|
||||
player->ConversationNPCAngle = 0.;
|
||||
ClearConversationStuff(player);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue