| 1038 | } |
| 1039 | |
| 1040 | bool Game_Interpreter::CommandControlSwitches(lcf::rpg::EventCommand const& com) { // code 10210 |
| 1041 | { |
| 1042 | int start, end; |
| 1043 | bool target_eval_result = DecodeTargetEvaluationMode< |
| 1044 | /* validate_patches */ true, |
| 1045 | /* support_range_indirect */ false, |
| 1046 | /* support_expressions */ false, |
| 1047 | /* support_bitmask */ false, |
| 1048 | /* support_scopes */ false |
| 1049 | >(com, start, end); |
| 1050 | if (!target_eval_result) { |
| 1051 | Output::Warning("ControlSwitches: Unsupported target evaluation mode {}", com.parameters[0]); |
| 1052 | return true; |
| 1053 | } |
| 1054 | |
| 1055 | int val = com.parameters[3]; |
| 1056 | |
| 1057 | if (start == end) { |
| 1058 | if (val < 2) { |
| 1059 | Main_Data::game_switches->Set(start, val == 0); |
| 1060 | } else { |
| 1061 | Main_Data::game_switches->Flip(start); |
| 1062 | } |
| 1063 | Game_Map::SetNeedRefreshForSwitchChange(start); |
| 1064 | } else { |
| 1065 | if (val < 2) { |
| 1066 | Main_Data::game_switches->SetRange(start, end, val == 0); |
| 1067 | } else { |
| 1068 | Main_Data::game_switches->FlipRange(start, end); |
| 1069 | } |
| 1070 | Game_Map::SetNeedRefresh(true); |
| 1071 | } |
| 1072 | } |
| 1073 | return true; |
| 1074 | } |
| 1075 | |
| 1076 | bool Game_Interpreter::CommandControlVariables(lcf::rpg::EventCommand const& com) { // code 10220 |
| 1077 | int value = 0; |