@@ -647,9 +647,9 @@ bool Game_Interpreter::ExecuteCommand(lcf::rpg::EventCommand const& com) {
647647 case Cmd::ChangeHeroTitle:
648648 return CommandChangeHeroTitle (com);
649649 case Cmd::ChangeSpriteAssociation:
650- return CommandChangeSpriteAssociation (com);
650+ return CmdSetup<&Game_Interpreter:: CommandChangeSpriteAssociation, 3 > (com);
651651 case Cmd::ChangeActorFace:
652- return CommandChangeActorFace (com);
652+ return CmdSetup<&Game_Interpreter:: CommandChangeActorFace, 4 > (com);
653653 case Cmd::ChangeVehicleGraphic:
654654 return CommandChangeVehicleGraphic (com);
655655 case Cmd::ChangeSystemBGM:
@@ -2110,16 +2110,8 @@ bool Game_Interpreter::CommandChangeSpriteAssociation(lcf::rpg::EventCommand con
21102110 }
21112111
21122112 auto file = ToString (CommandStringOrVariableBitfield (com, 3 , 1 , 4 ));
2113-
2114- int idx = 0 ;
2115- if (com.parameters .size () > 1 ) {
2116- idx = ValueOrVariableBitfield (com, 3 , 2 , 1 );
2117- }
2118-
2119- bool transparent = false ;
2120- if (com.parameters .size () > 2 ) {
2121- transparent = com.parameters [2 ] != 0 ;
2122- }
2113+ int idx = ValueOrVariableBitfield (com, 3 , 2 , 1 );
2114+ bool transparent = com.parameters [2 ] != 0 ;
21232115
21242116 actor->SetSprite (file, idx, transparent);
21252117 Main_Data::game_player->ResetGraphic ();
@@ -2129,15 +2121,14 @@ bool Game_Interpreter::CommandChangeSpriteAssociation(lcf::rpg::EventCommand con
21292121bool Game_Interpreter::CommandChangeActorFace (lcf::rpg::EventCommand const & com) { // code 10640
21302122 int id = ValueOrVariableBitfield (com, 2 , 0 , 0 );
21312123 Game_Actor* actor = Main_Data::game_actors->GetActor (id);
2132-
21332124 if (!actor) {
21342125 Output::Warning (" CommandChangeActorFace: Invalid actor ID {}" , id);
21352126 return true ;
21362127 }
21372128
21382129 actor->SetFace (
2139- ToString (CommandStringOrVariableBitfield (com, 2 , 1 , 3 )),
2140- ValueOrVariableBitfield (com, 2 , 2 , 1 ));
2130+ ToString (CommandStringOrVariableBitfield (com, 2 , 1 , 3 )),
2131+ ValueOrVariableBitfield (com, 2 , 2 , 1 ));
21412132 return true ;
21422133}
21432134
0 commit comments