Allow limiting NPC conversations to settings controllers

Also cleans up the network menu a little bit.
This commit is contained in:
Boondorl 2025-07-01 20:35:03 -04:00 committed by Rachael Alexanderson
commit 311e1d09be
4 changed files with 17 additions and 21 deletions

View file

@ -114,6 +114,8 @@ static FRandom pr_crunch("DoCrunch");
TArray<spechit_t> spechit;
TArray<spechit_t> portalhit;
EXTERN_CVAR(Bool, net_limitconversations)
//==========================================================================
//
// P_ShouldPassThroughPlayer
@ -5733,11 +5735,17 @@ DEFINE_ACTION_FUNCTION_NATIVE(AActor, HasConversation, HasConversation)
ACTION_RETURN_BOOL(HasConversation(self));
}
static int NativeStartConversation(AActor *self, AActor *player, bool faceTalker, bool saveAngle)
int NativeStartConversation(AActor *self, AActor *player, bool faceTalker, bool saveAngle)
{
if (!CanTalk(self))
return false;
if (netgame && net_limitconversations && player->player != nullptr && player->player->mo == player && !player->player->settings_controller)
{
Printf("Only settings controllers can start conversations with NPCs\n");
return false;
}
self->ConversationAnimation(0);
P_StartConversation(self, player, faceTalker, saveAngle);
return true;