Skip to content

Commit

Permalink
DREAMWEB: Fix crash when loading some saves
Browse files Browse the repository at this point in the history
findsource() has the hidden side effect of modifying kTakeoff,
and the getreelframeax() conversion reordered a findsource() call
and kTakeoff access in e78a5a2.
  • Loading branch information
wjp committed Aug 17, 2011
1 parent 7eab6a7 commit b82f40d
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion engines/dreamweb/sprite.cpp
Expand Up @@ -565,8 +565,9 @@ void DreamGenContext::showgamereel() {

const Frame *DreamGenContext::getreelframeax(uint16 frame) {
data.word(kCurrentframe) = frame;
Frame* source = findsourceCPP();
uint16 offset = data.word(kCurrentframe) - data.word(kTakeoff);
return findsourceCPP() + offset;
return source + offset;
}

void DreamGenContext::showrain() {
Expand Down

1 comment on commit b82f40d

@tramboi
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wow, nicely found wjp, this one was vicious.

Please sign in to comment.