Skip to content

Commit

Permalink
ScriptedAnimation: z and y pos were inverted when reading #481
Browse files Browse the repository at this point in the history
tested a bunch and everything seems to still be fine
there are other potential z/y swaps to be done, but I didn't find a counterexample
  • Loading branch information
lynxlynxlynx committed Jan 16, 2020
1 parent 22b318e commit 48e20b5
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion gemrb/core/Scriptable/Actor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -9192,7 +9192,7 @@ void Actor::AddVVCell(ScriptedAnimation* vvc)
if (!vvc) {
return;
}
if (vvc->ZPos<0) {
if (vvc->YPos < 0) {
vvcCells=&vvcShields;
} else {
vvcCells=&vvcOverlays;
Expand Down
4 changes: 2 additions & 2 deletions gemrb/core/ScriptedAnimation.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -266,7 +266,7 @@ ScriptedAnimation::ScriptedAnimation(DataStream* stream)
stream->ReadDword( &tmp );
XPos = (signed) tmp;
stream->ReadDword( &tmp ); //this affects visibility
ZPos = (signed) tmp;
YPos = (signed) tmp;
stream->Seek( 4, GEM_CURRENT_POS );
stream->ReadDword( &FrameRate );

Expand All @@ -275,7 +275,7 @@ ScriptedAnimation::ScriptedAnimation(DataStream* stream)
stream->ReadDword( &FaceTarget );
stream->Seek( 16, GEM_CURRENT_POS );
stream->ReadDword( &tmp ); //this doesn't affect visibility
YPos = (signed) tmp;
ZPos = (signed) tmp;
stream->ReadDword( &LightX );
stream->ReadDword( &LightY );
stream->ReadDword( &LightZ );
Expand Down

0 comments on commit 48e20b5

Please sign in to comment.