Navigation Menu

Skip to content

Commit

Permalink
Hopefully fix #1198 by removing original_pattern
Browse files Browse the repository at this point in the history
original_pattern isn't actually RPG_RT behavior, apparently - the issue 1198 shows this.

I made a testcase, but not much of one.
 I had hoped to check different ways of setting the pattern,
 but apparently walking and page changes are the only things that do it.

So, test this with stuff before considering applying.
Thanks to Ghabry for basically doing most of the work.
The technical description given plus a look through the code showed original_pattern wasn't being honoured, and now I know why.
  • Loading branch information
20kdc committed Oct 29, 2017
1 parent af5aca6 commit 49b296c
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 6 deletions.
5 changes: 2 additions & 3 deletions src/game_character.cpp
Expand Up @@ -34,7 +34,6 @@
Game_Character::Game_Character() :
tile_id(0),
pattern(RPG::EventPage::Frame_middle),
original_pattern(RPG::EventPage::Frame_middle),
last_pattern(0),
animation_id(0),
animation_type(RPG::EventPage::AnimType_non_continuous),
Expand Down Expand Up @@ -202,15 +201,15 @@ void Game_Character::UpdateSprite() {
anime_count++;
} else {
stop_count++;
if ((walk_animation && (IsSpinning() || IsContinuous())) || pattern != original_pattern)
if ((walk_animation && (IsSpinning() || IsContinuous())) || pattern != RPG::EventPage::Frame_middle)
anime_count++;
}

if (anime_count >= GetSteppingSpeed()) {
if (IsSpinning()) {
SetSpriteDirection((GetSpriteDirection() + 1) % 4);
} else if (!IsContinuous() && IsStopping()) {
pattern = original_pattern;
pattern = RPG::EventPage::Frame_middle;
last_pattern = last_pattern == RPG::EventPage::Frame_left ? RPG::EventPage::Frame_right : RPG::EventPage::Frame_left;
} else {
if (last_pattern == RPG::EventPage::Frame_left) {
Expand Down
1 change: 0 additions & 1 deletion src/game_character.h
Expand Up @@ -687,7 +687,6 @@ class Game_Character {

int tile_id;
int pattern;
int original_pattern;
int last_pattern;
int animation_id;
int animation_type;
Expand Down
2 changes: 0 additions & 2 deletions src/game_event.cpp
Expand Up @@ -265,7 +265,6 @@ void Game_Event::Setup(const RPG::EventPage* new_page) {
tile_id = page->character_name.empty() ? page->character_index : 0;

pattern = page->character_pattern;
original_pattern = pattern;

move_type = page->move_type;
SetMoveSpeed(page->move_speed);
Expand Down Expand Up @@ -310,7 +309,6 @@ void Game_Event::SetupFromSave(const RPG::EventPage* new_page) {
tile_id = page->character_name.empty() ? page->character_index : 0;

pattern = page->character_pattern;
original_pattern = pattern;

move_type = page->move_type;
original_move_route = page->move_route;
Expand Down

0 comments on commit 49b296c

Please sign in to comment.