Skip to content

Commit

Permalink
Replace some begin/rbegin usage with front/back
Browse files Browse the repository at this point in the history
  • Loading branch information
edo9300 committed Aug 11, 2023
1 parent 13ad895 commit 5a696fb
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 12 deletions.
4 changes: 2 additions & 2 deletions effect.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -515,9 +515,9 @@ int32_t effect::is_chainable(uint8_t tp) {
if(pduel->game_field->core.current_chain.size()) {
if(!is_flag(EFFECT_FLAG_FIELD_ONLY) && (type & EFFECT_TYPE_TRIGGER_O)
&& (get_handler()->current.location == LOCATION_HAND)) {
if(pduel->game_field->core.current_chain.rbegin()->triggering_effect->get_speed() > 2)
if(pduel->game_field->core.current_chain.back().triggering_effect->get_speed() > 2)
return FALSE;
} else if(sp < pduel->game_field->core.current_chain.rbegin()->triggering_effect->get_speed())
} else if(sp < pduel->game_field->core.current_chain.back().triggering_effect->get_speed())
return FALSE;
}
for(const auto& ch_lim : pduel->game_field->core.chain_limit) {
Expand Down
18 changes: 9 additions & 9 deletions operations.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5352,9 +5352,9 @@ int32_t field::operation_replace(uint16_t step, effect* replace_effect, group* t
return FALSE;
}
case 3: {
if(core.continuous_chain.rbegin()->target_cards)
pduel->delete_group(core.continuous_chain.rbegin()->target_cards);
for(auto& oit : core.continuous_chain.rbegin()->opinfos) {
if(core.continuous_chain.back().target_cards)
pduel->delete_group(core.continuous_chain.back().target_cards);
for(auto& oit : core.continuous_chain.back().opinfos) {
if(oit.second.op_cards)
pduel->delete_group(oit.second.op_cards);
}
Expand Down Expand Up @@ -5419,9 +5419,9 @@ int32_t field::operation_replace(uint16_t step, effect* replace_effect, group* t
return FALSE;
}
case 8: {
if(core.continuous_chain.rbegin()->target_cards)
pduel->delete_group(core.continuous_chain.rbegin()->target_cards);
for(auto& oit : core.continuous_chain.rbegin()->opinfos) {
if(core.continuous_chain.back().target_cards)
pduel->delete_group(core.continuous_chain.back().target_cards);
for(auto& oit : core.continuous_chain.back().opinfos) {
if(oit.second.op_cards)
pduel->delete_group(oit.second.op_cards);
}
Expand Down Expand Up @@ -5536,9 +5536,9 @@ int32_t field::operation_replace(uint16_t step, effect* replace_effect, group* t
return FALSE;
}
case 16: {
if(core.continuous_chain.rbegin()->target_cards)
pduel->delete_group(core.continuous_chain.rbegin()->target_cards);
for(auto& oit : core.continuous_chain.rbegin()->opinfos) {
if(core.continuous_chain.back().target_cards)
pduel->delete_group(core.continuous_chain.back().target_cards);
for(auto& oit : core.continuous_chain.back().opinfos) {
if(oit.second.op_cards)
pduel->delete_group(oit.second.op_cards);
}
Expand Down
2 changes: 1 addition & 1 deletion processor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2705,7 +2705,7 @@ int32_t field::process_battle_command(uint16_t step) {
}
else if(core.tpchain.size() == 1){
core.sub_solving_event.push_back(nil_event);
add_process(PROCESSOR_EXECUTE_OPERATION, 0, core.tpchain.begin()->triggering_effect, 0, infos.turn_player, 0);
add_process(PROCESSOR_EXECUTE_OPERATION, 0, core.tpchain.front().triggering_effect, 0, infos.turn_player, 0);
adjust_all();
}
return FALSE;
Expand Down

0 comments on commit 5a696fb

Please sign in to comment.