Allow limiting NPC conversations to settings controllers
Also cleans up the network menu a little bit.
This commit is contained in:
parent
3fba33204c
commit
311e1d09be
4 changed files with 17 additions and 21 deletions
|
|
@ -160,6 +160,7 @@ CVAR(Bool, vid_lowerinbackground, true, CVAR_ARCHIVE|CVAR_GLOBALCONFIG)
|
|||
CVAR(Bool, net_ticbalance, false, CVAR_SERVERINFO | CVAR_NOSAVE) // Currently deprecated, but may be brought back later.
|
||||
CVAR(Bool, net_extratic, false, CVAR_SERVERINFO | CVAR_NOSAVE)
|
||||
CVAR(Bool, net_repeatableactioncooldown, true, CVAR_SERVERINFO | CVAR_NOSAVE)
|
||||
CVAR(Bool, net_limitconversations, false, CVAR_SERVERINFO | CVAR_NOSAVE)
|
||||
CUSTOM_CVAR(Int, net_disablepause, 0, CVAR_SERVERINFO | CVAR_NOSAVE)
|
||||
{
|
||||
if (self < 0)
|
||||
|
|
|
|||
|
|
@ -134,6 +134,8 @@ FName MODtoDamageType (int mod)
|
|||
}
|
||||
}
|
||||
|
||||
int NativeStartConversation(AActor* self, AActor* player, bool faceTalker, bool saveAngle);
|
||||
|
||||
FUNC(LS_NOP)
|
||||
{
|
||||
return false;
|
||||
|
|
@ -3401,24 +3403,7 @@ FUNC(LS_StartConversation)
|
|||
return false;
|
||||
}
|
||||
|
||||
// Dead things can't talk.
|
||||
if (target->health <= 0)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
// Fighting things don't talk either.
|
||||
if (target->flags4 & MF4_INCOMBAT)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
if (target->Conversation != NULL)
|
||||
{
|
||||
// Give the NPC a chance to play a brief animation
|
||||
target->ConversationAnimation (0);
|
||||
P_StartConversation (target, it, !!arg1, true);
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
return NativeStartConversation(target, it, !!arg1, true);
|
||||
}
|
||||
|
||||
FUNC(LS_Thing_SetConversation)
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
|
|
|||
|
|
@ -2440,11 +2440,13 @@ OptionMenu NetworkOptions protected
|
|||
StaticText " "
|
||||
StaticText "$NETMNU_HOSTOPTIONS", 1
|
||||
Option "$NETMNU_EXTRATICS", "net_extratic", "OnOff"
|
||||
Option "$NETMNU_LIMITCONVO", "net_limitconversations", "OnOff"
|
||||
Option "$NETMNU_REPEATCOOLDOWN", "net_repeatableactioncooldown", "OnOff"
|
||||
Option "$NETMNU_DISABLEPAUSE", "net_disablepause", "PauseTypes"
|
||||
Option "$NETMNU_READYTYPE", "net_cutscenereadytype", "ReadyTypes"
|
||||
Slider "$NETMNU_READYPERCENT", "net_cutscenereadypercent", "0", "1", "0.05", 2
|
||||
NumberField "$NETMNU_READYCOUNTDOWN", "net_cutscenecountdown", 0, 300, 5
|
||||
NumberField "$NETMNU_CHATSLOMO", "net_chatslowmode", 0, 300, 5
|
||||
Slider "$NETMNU_READYCOUNTDOWN", "net_cutscenecountdown", 0, 300, 5
|
||||
Slider "$NETMNU_CHATSLOMO", "net_chatslowmode", 0, 300, 5
|
||||
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue