Skip to content

Commit

Permalink
IncrementGlobalOnce: Increase both variables, not just the second
Browse files Browse the repository at this point in the history
 -fixes DUHIR.DLG uhir's lucky knife quest and hopefully many others
  • Loading branch information
chilvence committed Jan 13, 2014
1 parent 1bbdb05 commit 188e980
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions gemrb/core/GameScript/Actions.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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 );
Expand Down

0 comments on commit 188e980

Please sign in to comment.