From 188e98008dd066eb33c3d1625a4492e8b020e953 Mon Sep 17 00:00:00 2001 From: Laurie Chilvers Date: Thu, 9 Jan 2014 23:53:21 +0000 Subject: [PATCH] IncrementGlobalOnce: Increase both variables, not just the second -fixes DUHIR.DLG uhir's lucky knife quest and hopefully many others --- gemrb/core/GameScript/Actions.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/gemrb/core/GameScript/Actions.cpp b/gemrb/core/GameScript/Actions.cpp index 1a20694d98..3db2d9d3fc 100644 --- a/gemrb/core/GameScript/Actions.cpp +++ b/gemrb/core/GameScript/Actions.cpp @@ -3308,6 +3308,12 @@ void GameScript::IncrementGlobalOnce(Scriptable* Sender, Action* parameters) if (value != 0) { return; } + //todo:the actual behaviour of this opcode may need to be verified, as this is + //just a best guess at how the two parameters are changed, and could + //well be more complex; the original usage of this function is currently + //not well understood (relates to hardcoded alignment changes) + SetVariable( Sender, parameters->string0Parameter, parameters->int0Parameter ); + value = CheckVariable( Sender, parameters->string1Parameter ); SetVariable( Sender, parameters->string1Parameter, value + parameters->int0Parameter );