Merge branch 'master' into scripting

Conflicts:
	src/actor.h
	src/dobject.h
	src/dobjgc.cpp
	src/p_local.h
	src/thingdef/thingdef_codeptr.cpp
This commit is contained in:
Randy Heit 2016-01-21 12:45:06 -06:00
commit 9744b9e0d9
34 changed files with 3971 additions and 3690 deletions

View file

@ -1345,22 +1345,30 @@ static void HandleReply(player_t *player, bool isconsole, int nodenum, int reply
if (reply->NextNode != 0)
{
int rootnode = npc->ConversationRoot;
unsigned next = (unsigned)(rootnode + (reply->NextNode < 0 ? -1 : 1) * reply->NextNode - 1);
const bool isNegative = reply->NextNode < 0;
const unsigned next = (unsigned)(rootnode + (isNegative ? -1 : 1) * reply->NextNode - 1);
if (next < StrifeDialogues.Size())
{
npc->Conversation = StrifeDialogues[next];
if (gameaction != ga_slideshow)
if (isNegative)
{
P_StartConversation (npc, player->mo, player->ConversationFaceTalker, false);
return;
}
else
{
S_StopSound (npc, CHAN_VOICE);
if (gameaction != ga_slideshow)
{
P_StartConversation (npc, player->mo, player->ConversationFaceTalker, false);
return;
}
else
{
S_StopSound (npc, CHAN_VOICE);
}
}
}
else
{
Printf ("Next node %u is invalid, no such dialog page\n", next);
}
}
npc->angle = player->ConversationNPCAngle;