From 8568c8f38b0c249f93be2ac52a5b700d3b32d59d Mon Sep 17 00:00:00 2001 From: salix5 Date: Sat, 9 Nov 2024 17:10:44 +0800 Subject: [PATCH] add duel::buffer_size() (#653) * add duel::buffer_size() * fix warning C4267 about size --- duel.cpp | 7 +- duel.h | 4 ++ field.h | 2 +- operations.cpp | 4 +- playerop.cpp | 4 +- processor.cpp | 184 ++++++++++++++++++++++++------------------------- 6 files changed, 105 insertions(+), 100 deletions(-) diff --git a/duel.cpp b/duel.cpp index 8687f30fd..9522fbdf2 100644 --- a/duel.cpp +++ b/duel.cpp @@ -98,9 +98,10 @@ void duel::delete_effect(effect* peffect) { delete peffect; } int32 duel::read_buffer(byte* buf) { - if(message_buffer.size()) - std::memcpy(buf, message_buffer.data(), message_buffer.size()); - return (int32)message_buffer.size(); + auto size = buffer_size(); + if (size) + std::memcpy(buf, message_buffer.data(), size); + return (int32)size; } void duel::release_script_group() { for(auto& pgroup : sgroups) { diff --git a/duel.h b/duel.h index ec1e002d7..ef071cb8b 100644 --- a/duel.h +++ b/duel.h @@ -13,6 +13,7 @@ #include "mtrandom.h" #include #include +#include class card; class group; @@ -40,6 +41,9 @@ class duel { ~duel(); void clear(); + uint32 buffer_size() const { + return (uint32)message_buffer.size() & PROCESSOR_BUFFER_LEN; + } card* new_card(uint32 code); group* new_group(); group* new_group(card* pcard); diff --git a/field.h b/field.h index 0b80d6c1b..05b8da017 100644 --- a/field.h +++ b/field.h @@ -627,7 +627,7 @@ class field { int32 toss_dice(uint16 step, effect* reason_effect, uint8 reason_player, uint8 playerid, uint8 count1, uint8 count2); int32 rock_paper_scissors(uint16 step, uint8 repeat); - bool check_response(int32 vector_size, int32 min_len, int32 max_len) const; + bool check_response(size_t vector_size, int32 min_len, int32 max_len) const; int32 select_battle_command(uint16 step, uint8 playerid); int32 select_idle_command(uint16 step, uint8 playerid); int32 select_effect_yes_no(uint16 step, uint8 playerid, uint32 description, card* pcard); diff --git a/operations.cpp b/operations.cpp index a0e8bd869..82b697900 100644 --- a/operations.cpp +++ b/operations.cpp @@ -4367,7 +4367,7 @@ int32 field::send_to(uint16 step, group * targets, effect * reason_effect, uint3 raise_single_event(pcard, 0, EVENT_DESTROYED, pcard->current.reason_effect, pcard->current.reason, pcard->current.reason_player, 0, 0); } if(pcard->xyz_materials.size()) { - pcard->xyz_materials_previous_count_onfield = pcard->xyz_materials.size(); + pcard->xyz_materials_previous_count_onfield = (int32)pcard->xyz_materials.size(); for(auto& mcard : pcard->xyz_materials) overlays.insert(mcard); } else { @@ -4711,7 +4711,7 @@ int32 field::move_to_field(uint16 step, card* target, uint32 enable, uint32 ret, } } if(target->xyz_materials.size()) { - target->xyz_materials_previous_count_onfield = target->xyz_materials.size(); + target->xyz_materials_previous_count_onfield = (int32)target->xyz_materials.size(); card_set overlays; overlays.insert(target->xyz_materials.begin(), target->xyz_materials.end()); send_to(&overlays, 0, REASON_LOST_OVERLAY + REASON_RULE, PLAYER_NONE, PLAYER_NONE, LOCATION_GRAVE, 0, POS_FACEUP); diff --git a/playerop.cpp b/playerop.cpp index 6dad934a2..92f048ee2 100644 --- a/playerop.cpp +++ b/playerop.cpp @@ -14,14 +14,14 @@ #include #include -bool field::check_response(int32 vector_size, int32 min_len, int32 max_len) const { +bool field::check_response(size_t vector_size, int32 min_len, int32 max_len) const { const int32 len = returns.bvalue[0]; if (len < min_len || len > max_len) return false; std::set index_set; for (int32 i = 0; i < len; ++i) { uint8 index = returns.bvalue[1 + i]; - if (index >=vector_size || index_set.count(index)) { + if (index >= (int32)vector_size || index_set.count(index)) { return false; } index_set.insert(index); diff --git a/processor.cpp b/processor.cpp index cc06be235..45e5665b9 100644 --- a/processor.cpp +++ b/processor.cpp @@ -36,7 +36,7 @@ uint32 field::process() { if (core.subunits.size()) core.units.splice(core.units.begin(), core.subunits); if (core.units.size() == 0) - return PROCESSOR_END | pduel->message_buffer.size(); + return PROCESSOR_END | pduel->buffer_size(); auto it = core.units.begin(); switch (it->type) { case PROCESSOR_ADJUST: { @@ -45,151 +45,151 @@ uint32 field::process() { else { ++it->step; } - return pduel->message_buffer.size(); + return pduel->buffer_size(); } case PROCESSOR_TURN: { if (process_turn(it->step, it->arg1)) core.units.pop_front(); else ++it->step; - return pduel->message_buffer.size(); + return pduel->buffer_size(); } case PROCESSOR_WAIT: { core.units.pop_front(); - return PROCESSOR_WAITING | pduel->message_buffer.size(); + return PROCESSOR_WAITING | pduel->buffer_size(); } case PROCESSOR_REFRESH_LOC: { if (refresh_location_info(it->step)) core.units.pop_front(); else ++it->step; - return pduel->message_buffer.size(); + return pduel->buffer_size(); } case PROCESSOR_SELECT_BATTLECMD: { if (select_battle_command(it->step, it->arg1)) { core.units.pop_front(); - return pduel->message_buffer.size(); + return pduel->buffer_size(); } else { it->step = 1; - return PROCESSOR_WAITING | pduel->message_buffer.size(); + return PROCESSOR_WAITING | pduel->buffer_size(); } } case PROCESSOR_SELECT_IDLECMD: { if (select_idle_command(it->step, it->arg1)) { core.units.pop_front(); - return pduel->message_buffer.size(); + return pduel->buffer_size(); } else { it->step = 1; - return PROCESSOR_WAITING | pduel->message_buffer.size(); + return PROCESSOR_WAITING | pduel->buffer_size(); } } case PROCESSOR_SELECT_EFFECTYN: { if (select_effect_yes_no(it->step, it->arg1, it->arg2, (card*)it->ptarget)) { core.units.pop_front(); - return pduel->message_buffer.size(); + return pduel->buffer_size(); } else { it->step = 1; - return PROCESSOR_WAITING | pduel->message_buffer.size(); + return PROCESSOR_WAITING | pduel->buffer_size(); } } case PROCESSOR_SELECT_YESNO: { if (select_yes_no(it->step, it->arg1, it->arg2)) { core.units.pop_front(); - return pduel->message_buffer.size(); + return pduel->buffer_size(); } else { it->step = 1; - return PROCESSOR_WAITING | pduel->message_buffer.size(); + return PROCESSOR_WAITING | pduel->buffer_size(); } } case PROCESSOR_SELECT_OPTION: { if (select_option(it->step, it->arg1)) { core.units.pop_front(); - return pduel->message_buffer.size(); + return pduel->buffer_size(); } else { it->step = 1; - return PROCESSOR_WAITING | pduel->message_buffer.size(); + return PROCESSOR_WAITING | pduel->buffer_size(); } } case PROCESSOR_SELECT_CARD: { if (select_card(it->step, it->arg1 & 0xff, (it->arg1 >> 16) & 0xff, (it->arg2) & 0xff, (it->arg2 >> 16) & 0xff)) { core.units.pop_front(); - return pduel->message_buffer.size(); + return pduel->buffer_size(); } else { it->step = 1; - return PROCESSOR_WAITING | pduel->message_buffer.size(); + return PROCESSOR_WAITING | pduel->buffer_size(); } } case PROCESSOR_SELECT_UNSELECT_CARD: { if (select_unselect_card(it->step, it->arg1 & 0xff, (it->arg1 >> 16) & 0xff, (it->arg2) & 0xff, (it->arg2 >> 16) & 0xff, (it->arg3) & 0xff)) { core.units.pop_front(); - return pduel->message_buffer.size(); + return pduel->buffer_size(); } else { it->step = 1; - return PROCESSOR_WAITING | pduel->message_buffer.size(); + return PROCESSOR_WAITING | pduel->buffer_size(); } } case PROCESSOR_SELECT_CHAIN: { if (select_chain(it->step, it->arg1, (it->arg2 & 0xffff), it->arg2 >> 16)) { core.units.pop_front(); - return pduel->message_buffer.size(); + return pduel->buffer_size(); } else { it->step = 1; - return PROCESSOR_WAITING | pduel->message_buffer.size(); + return PROCESSOR_WAITING | pduel->buffer_size(); } } case PROCESSOR_SELECT_DISFIELD: case PROCESSOR_SELECT_PLACE: { if (select_place(it->step, it->arg1, it->arg2, it->arg3)) { core.units.pop_front(); - return pduel->message_buffer.size(); + return pduel->buffer_size(); } else { it->step = 1; - return PROCESSOR_WAITING | pduel->message_buffer.size(); + return PROCESSOR_WAITING | pduel->buffer_size(); } } case PROCESSOR_SELECT_POSITION: { if (select_position(it->step, it->arg1 & 0xffff, it->arg2, (it->arg1 >> 16) & 0xffff)) { core.units.pop_front(); - return pduel->message_buffer.size(); + return pduel->buffer_size(); } else { it->step = 1; - return PROCESSOR_WAITING | pduel->message_buffer.size(); + return PROCESSOR_WAITING | pduel->buffer_size(); } } case PROCESSOR_SELECT_TRIBUTE_P: { if (select_tribute(it->step, it->arg1 & 0xff, (it->arg1 >> 16) & 0xff, (it->arg2) & 0xff, (it->arg2 >> 16) & 0xff)) { core.units.pop_front(); - return pduel->message_buffer.size(); + return pduel->buffer_size(); } else { it->step = 1; - return PROCESSOR_WAITING | pduel->message_buffer.size(); + return PROCESSOR_WAITING | pduel->buffer_size(); } } case PROCESSOR_SELECT_COUNTER: { if (select_counter(it->step, it->arg1, it->arg2, it->arg3, it->arg4 >> 8, it->arg4 & 0xff)) { core.units.pop_front(); - return pduel->message_buffer.size(); + return pduel->buffer_size(); } else { it->step = 1; - return PROCESSOR_WAITING | pduel->message_buffer.size(); + return PROCESSOR_WAITING | pduel->buffer_size(); } } case PROCESSOR_SELECT_SUM: { if (select_with_sum_limit(it->step, it->arg2, it->arg1, it->arg3, it->arg4)) { core.units.pop_front(); - return pduel->message_buffer.size(); + return pduel->buffer_size(); } else { it->step = 1; - return PROCESSOR_WAITING | pduel->message_buffer.size(); + return PROCESSOR_WAITING | pduel->buffer_size(); } } case PROCESSOR_SORT_CARD: { if (sort_card(it->step, it->arg1)) { core.units.pop_front(); - return pduel->message_buffer.size(); + return pduel->buffer_size(); } else { it->step = 1; - return PROCESSOR_WAITING | pduel->message_buffer.size(); + return PROCESSOR_WAITING | pduel->buffer_size(); } } case PROCESSOR_SELECT_RELEASE: { @@ -197,77 +197,77 @@ uint32 field::process() { core.units.pop_front(); else ++it->step; - return pduel->message_buffer.size(); + return pduel->buffer_size(); } case PROCESSOR_SELECT_TRIBUTE: { if (select_tribute_cards(it->step, (card*)it->ptarget, it->arg1 & 0xff, (it->arg1 >> 16) & 0xff, (it->arg2) & 0xff, (it->arg2 >> 16) & 0xff, it->arg3, it->arg4)) core.units.pop_front(); else ++it->step; - return pduel->message_buffer.size(); + return pduel->buffer_size(); } case PROCESSOR_POINT_EVENT: { if(process_point_event(it->step, it->arg1 & 0xff, (it->arg1 >> 8) & 0xff, it->arg2)) core.units.pop_front(); else ++it->step; - return pduel->message_buffer.size(); + return pduel->buffer_size(); } case PROCESSOR_QUICK_EFFECT: { if(process_quick_effect(it->step, it->arg1, it->arg2)) core.units.pop_front(); else ++it->step; - return pduel->message_buffer.size(); + return pduel->buffer_size(); } case PROCESSOR_IDLE_COMMAND: { if(process_idle_command(it->step)) core.units.pop_front(); else ++it->step; - return pduel->message_buffer.size(); + return pduel->buffer_size(); } case PROCESSOR_PHASE_EVENT: { if(process_phase_event(it->step, it->arg1)) core.units.pop_front(); else ++it->step; - return pduel->message_buffer.size(); + return pduel->buffer_size(); } case PROCESSOR_BATTLE_COMMAND: { if(process_battle_command(it->step)) core.units.pop_front(); else ++it->step; - return pduel->message_buffer.size(); + return pduel->buffer_size(); } case PROCESSOR_DAMAGE_STEP: { if(process_damage_step(it->step, it->arg2)) core.units.pop_front(); else ++it->step; - return pduel->message_buffer.size(); + return pduel->buffer_size(); } case PROCESSOR_ADD_CHAIN: { if (add_chain(it->step)) core.units.pop_front(); else ++it->step; - return pduel->message_buffer.size(); + return pduel->buffer_size(); } case PROCESSOR_SOLVE_CHAIN: { if (solve_chain(it->step, it->arg1, it->arg2)) core.units.pop_front(); else ++it->step; - return pduel->message_buffer.size(); + return pduel->buffer_size(); } case PROCESSOR_SOLVE_CONTINUOUS: { if (solve_continuous(it->step)) core.units.pop_front(); else ++it->step; - return pduel->message_buffer.size(); + return pduel->buffer_size(); } case PROCESSOR_EXECUTE_COST: { if (execute_cost(it->step, it->peffect, it->arg1)) { @@ -275,7 +275,7 @@ uint32 field::process() { core.solving_event.pop_front(); } else ++it->step; - return pduel->message_buffer.size(); + return pduel->buffer_size(); } case PROCESSOR_EXECUTE_OPERATION: { if (execute_operation(it->step, it->peffect, it->arg1)) { @@ -283,7 +283,7 @@ uint32 field::process() { core.solving_event.pop_front(); } else ++it->step; - return pduel->message_buffer.size(); + return pduel->buffer_size(); } case PROCESSOR_EXECUTE_TARGET: { if (execute_target(it->step, it->peffect, it->arg1)) { @@ -291,140 +291,140 @@ uint32 field::process() { core.solving_event.pop_front(); } else ++it->step; - return pduel->message_buffer.size(); + return pduel->buffer_size(); } case PROCESSOR_DESTROY: { if (destroy(it->step, it->ptarget, it->peffect, it->arg1, it->arg2)) core.units.pop_front(); else ++it->step; - return pduel->message_buffer.size(); + return pduel->buffer_size(); } case PROCESSOR_RELEASE: { if (release(it->step, it->ptarget, it->peffect, it->arg1, it->arg2)) core.units.pop_front(); else ++it->step; - return pduel->message_buffer.size(); + return pduel->buffer_size(); } case PROCESSOR_SENDTO: { if (send_to(it->step, it->ptarget, it->peffect, it->arg1, it->arg2, it->arg3)) core.units.pop_front(); else ++it->step; - return pduel->message_buffer.size(); + return pduel->buffer_size(); } case PROCESSOR_DESTROY_REPLACE: { if(destroy_replace(it->step, it->ptarget, (card*)it->ptr1, it->arg2)) core.units.pop_front(); else ++it->step; - return pduel->message_buffer.size(); + return pduel->buffer_size(); } case PROCESSOR_RELEASE_REPLACE: { if (release_replace(it->step, it->ptarget, (card*)it->ptr1)) core.units.pop_front(); else ++it->step; - return pduel->message_buffer.size(); + return pduel->buffer_size(); } case PROCESSOR_SENDTO_REPLACE: { if (send_replace(it->step, it->ptarget, (card*)it->ptr1)) core.units.pop_front(); else ++it->step; - return pduel->message_buffer.size(); + return pduel->buffer_size(); } case PROCESSOR_MOVETOFIELD: { if (move_to_field(it->step, (card*)it->ptarget, it->arg1, it->arg2 & 0xff, (it->arg2 >> 8) & 0xff, it->arg3)) core.units.pop_front(); else ++it->step; - return pduel->message_buffer.size(); + return pduel->buffer_size(); } case PROCESSOR_CHANGEPOS: { if (change_position(it->step, it->ptarget, it->peffect, it->arg1, it->arg2)) core.units.pop_front(); else ++it->step; - return pduel->message_buffer.size(); + return pduel->buffer_size(); } case PROCESSOR_OPERATION_REPLACE: { if (operation_replace(it->step, it->peffect, it->ptarget, (card*)it->ptr1, it->arg1)) core.units.pop_front(); else ++it->step; - return pduel->message_buffer.size(); + return pduel->buffer_size(); } case PROCESSOR_ACTIVATE_EFFECT: { if (activate_effect(it->step, it->peffect)) core.units.pop_front(); else ++it->step; - return pduel->message_buffer.size(); + return pduel->buffer_size(); } case PROCESSOR_SUMMON_RULE: { if (summon(it->step, it->arg1 & 0xff, (card*)it->ptarget, it->peffect, (it->arg1 >> 8) & 0xff, (it->arg1 >> 16) & 0xff, (it->arg1 >> 24) & 0xff, it->arg2)) core.units.pop_front(); else ++it->step; - return pduel->message_buffer.size(); + return pduel->buffer_size(); } case PROCESSOR_SPSUMMON_RULE: { if (special_summon_rule(it->step, it->arg1, (card*)it->ptarget, it->arg2, it->arg3)) core.units.pop_front(); else ++it->step; - return pduel->message_buffer.size(); + return pduel->buffer_size(); } case PROCESSOR_SPSUMMON: { if (special_summon(it->step, it->peffect, it->arg1, it->ptarget, it->arg2)) core.units.pop_front(); else ++it->step; - return pduel->message_buffer.size(); + return pduel->buffer_size(); } case PROCESSOR_FLIP_SUMMON: { if (flip_summon(it->step, it->arg1, (card*)(it->ptarget), it->arg2)) core.units.pop_front(); else ++it->step; - return pduel->message_buffer.size(); + return pduel->buffer_size(); } case PROCESSOR_MSET: { if (mset(it->step, it->arg1 & 0xff, (card*)it->ptarget, it->peffect, (it->arg1 >> 8) & 0xff, (it->arg1 >> 16) & 0xff, (it->arg1 >> 24) & 0xff, it->arg2)) core.units.pop_front(); else ++it->step; - return pduel->message_buffer.size(); + return pduel->buffer_size(); } case PROCESSOR_SSET: { if (sset(it->step, it->arg1, it->arg2, (card*)(it->ptarget), it->peffect)) core.units.pop_front(); else ++it->step; - return pduel->message_buffer.size(); + return pduel->buffer_size(); } case PROCESSOR_SPSUMMON_STEP: { if (special_summon_step(it->step, it->ptarget, (card*)(it->ptr1), it->arg1)) core.units.pop_front(); else ++it->step; - return pduel->message_buffer.size(); + return pduel->buffer_size(); } case PROCESSOR_SSET_G: { if (sset_g(it->step, it->arg1, it->arg2, it->ptarget, it->arg3, it->peffect)) { core.units.pop_front(); } else ++it->step; - return pduel->message_buffer.size(); + return pduel->buffer_size(); } case PROCESSOR_DRAW : { if (draw(it->step, it->peffect, it->arg1, (it->arg2 >> 4) & 0xf, (it->arg2) & 0xf, it->arg3)) core.units.pop_front(); else ++it->step; - return pduel->message_buffer.size(); + return pduel->buffer_size(); } case PROCESSOR_DAMAGE: { int32 reason = it->arg1; @@ -442,7 +442,7 @@ uint32 field::process() { core.units.pop_front(); } else ++it->step; - return pduel->message_buffer.size(); + return pduel->buffer_size(); } case PROCESSOR_RECOVER: { if (recover(it->step, it->peffect, it->arg1, (it->arg2 >> 2) & 0x3, (it->arg2) & 0x3, it->arg3, (it->arg2 >> 4) & 0x1)) { @@ -453,56 +453,56 @@ uint32 field::process() { core.units.pop_front(); } else ++it->step; - return pduel->message_buffer.size(); + return pduel->buffer_size(); } case PROCESSOR_EQUIP: { if (equip(it->step, it->arg2 & 0xffff, (card*)it->ptr1, (card*)it->ptarget, (it->arg2 >> 16) & 0xff, (it->arg2 >> 24) & 0xff)) core.units.pop_front(); else ++it->step; - return pduel->message_buffer.size(); + return pduel->buffer_size(); } case PROCESSOR_GET_CONTROL: { if (get_control(it->step, it->peffect, (it->arg2 >> 28) & 0xf, it->ptarget, (it->arg2 >> 24) & 0xf, (it->arg2 >> 8) & 0x3ff, it->arg2 & 0xff, it->arg3)) { core.units.pop_front(); } else ++it->step; - return pduel->message_buffer.size(); + return pduel->buffer_size(); } case PROCESSOR_SWAP_CONTROL: { if (swap_control(it->step, it->peffect, it->arg1, it->ptarget, (group*)it->ptr1, it->arg2, it->arg3)) { core.units.pop_front(); } else ++it->step; - return pduel->message_buffer.size(); + return pduel->buffer_size(); } case PROCESSOR_SELF_DESTROY: { if (self_destroy(it->step, (card*)it->ptr1, it->arg1)) { core.units.pop_front(); } else ++it->step; - return pduel->message_buffer.size(); + return pduel->buffer_size(); } case PROCESSOR_TRAP_MONSTER_ADJUST: { if (trap_monster_adjust(it->step)) core.units.pop_front(); else ++it->step; - return pduel->message_buffer.size(); + return pduel->buffer_size(); } case PROCESSOR_PAY_LPCOST: { if (pay_lp_cost(it->step, it->arg1, it->arg2, it->arg3)) core.units.pop_front(); else ++it->step; - return pduel->message_buffer.size(); + return pduel->buffer_size(); } case PROCESSOR_REMOVE_COUNTER: { if (remove_counter(it->step, it->arg4, (card*)it->ptarget, (it->arg1 >> 16) & 0xff, (it->arg1 >> 8) & 0xff, it->arg1 & 0xff, it->arg2, it->arg3)) { core.units.pop_front(); } else ++it->step; - return pduel->message_buffer.size(); + return pduel->buffer_size(); } case PROCESSOR_ATTACK_DISABLE: { if(it->step == 0) { @@ -529,7 +529,7 @@ uint32 field::process() { returns.ivalue[0] = 1; core.units.pop_front(); } - return pduel->message_buffer.size(); + return pduel->buffer_size(); } case PROCESSOR_ANNOUNCE_RACE: { if(announce_race(it->step, it->arg1 & 0xffff, it->arg1 >> 16, it->arg2)) { @@ -537,7 +537,7 @@ uint32 field::process() { } else { ++it->step; } - return PROCESSOR_WAITING | pduel->message_buffer.size(); + return PROCESSOR_WAITING | pduel->buffer_size(); } case PROCESSOR_ANNOUNCE_ATTRIB: { if(announce_attribute(it->step, it->arg1 & 0xffff, it->arg1 >> 16, it->arg2)) { @@ -545,7 +545,7 @@ uint32 field::process() { } else { ++it->step; } - return PROCESSOR_WAITING | pduel->message_buffer.size(); + return PROCESSOR_WAITING | pduel->buffer_size(); } case PROCESSOR_ANNOUNCE_CARD: { if(announce_card(it->step, it->arg1)) { @@ -553,7 +553,7 @@ uint32 field::process() { } else { ++it->step; } - return PROCESSOR_WAITING | pduel->message_buffer.size(); + return PROCESSOR_WAITING | pduel->buffer_size(); } case PROCESSOR_ANNOUNCE_NUMBER: { if(announce_number(it->step, it->arg1)) { @@ -561,28 +561,28 @@ uint32 field::process() { } else { ++it->step; } - return PROCESSOR_WAITING | pduel->message_buffer.size(); + return PROCESSOR_WAITING | pduel->buffer_size(); } case PROCESSOR_TOSS_DICE: { if(toss_dice(it->step, it->peffect, it->arg1 >> 16, it->arg1 & 0xff, it->arg2 & 0xff, it->arg2 >> 16)) { core.units.pop_front(); } else ++it->step; - return pduel->message_buffer.size(); + return pduel->buffer_size(); } case PROCESSOR_TOSS_COIN: { if (toss_coin(it->step, it->peffect, (it->arg1 >> 16), it->arg1 & 0xff, it->arg2)) { core.units.pop_front(); } else ++it->step; - return pduel->message_buffer.size(); + return pduel->buffer_size(); } case PROCESSOR_ROCK_PAPER_SCISSORS: { if (rock_paper_scissors(it->step, it->arg1)) { core.units.pop_front(); } else ++it->step; - return pduel->message_buffer.size(); + return pduel->buffer_size(); } case PROCESSOR_SELECT_FUSION: { if(it->step == 0) { @@ -593,7 +593,7 @@ uint32 field::process() { core.fusion_materials.clear(); if(!it->peffect) { core.units.pop_front(); - return pduel->message_buffer.size(); + return pduel->buffer_size(); } core.not_material = it->arg2; core.sub_solving_event.push_back(e); @@ -605,7 +605,7 @@ uint32 field::process() { core.not_material = 0; core.units.pop_front(); } - return pduel->message_buffer.size(); + return pduel->buffer_size(); } case PROCESSOR_SELECT_SYNCHRO: { int32 ret = TRUE; @@ -617,14 +617,14 @@ uint32 field::process() { core.units.pop_front(); else ++it->step; - return pduel->message_buffer.size(); + return pduel->buffer_size(); } case PROCESSOR_SELECT_XMATERIAL: { if (select_xyz_material(it->step, it->arg1 & 0xffff, it->arg1 >> 16, (card*)it->ptarget, it->arg2 & 0xffff, it->arg2 >> 16)) core.units.pop_front(); else ++it->step; - return pduel->message_buffer.size(); + return pduel->buffer_size(); } case PROCESSOR_DISCARD_HAND: { if(it->step == 0) { @@ -651,7 +651,7 @@ uint32 field::process() { } else { core.units.pop_front(); } - return pduel->message_buffer.size(); + return pduel->buffer_size(); } case PROCESSOR_DISCARD_DECK: { if(discard_deck(it->step, it->arg1 & 0xff, it->arg1 >> 16, it->arg2)) { @@ -659,7 +659,7 @@ uint32 field::process() { } else { ++it->step; } - return pduel->message_buffer.size(); + return pduel->buffer_size(); } case PROCESSOR_SORT_DECK: { uint8 sort_player = it->arg1 & 0xffff; @@ -710,7 +710,7 @@ uint32 field::process() { } core.units.pop_front(); } - return pduel->message_buffer.size(); + return pduel->buffer_size(); } case PROCESSOR_REMOVE_OVERLAY: { if(remove_overlay_card(it->step, it->arg3, (card*)(it->ptarget), it->arg1 >> 16, @@ -719,10 +719,10 @@ uint32 field::process() { } else { ++it->step; } - return pduel->message_buffer.size(); + return pduel->buffer_size(); } } - return pduel->message_buffer.size(); + return pduel->buffer_size(); } #ifdef _MSC_VER #pragma warning(pop)