Commit 3ca0ac3b authored by Chen Bill's avatar Chen Bill

update signature of query_field_card()

bit field: uint32
offset: int32
parent 23b9ae8d
......@@ -121,7 +121,7 @@ card::card(duel* pd) {
spsummon_code = 0;
current.controler = PLAYER_NONE;
}
uint32 card::get_infos(byte* buf, int32 query_flag, int32 use_cache) {
int32 card::get_infos(byte* buf, uint32 query_flag, int32 use_cache) {
int32* p = (int32*)buf;
int32 tdata = 0;
std::pair<int32, int32> atk_def(-10, -10);
......@@ -256,9 +256,12 @@ uint32 card::get_infos(byte* buf, int32 query_flag, int32 use_cache) {
} else query_flag &= ~QUERY_LINK;
}
}
*(uint32*)buf = (uint32)((byte*)p - buf);
*(uint32*)(buf + 4) = query_flag;
return (uint32)((byte*)p - buf);
int32* finalize = (int32*)buf;
*finalize = (byte*)p - buf;
++finalize;
*finalize = query_flag;
++finalize;
return (byte*)p - buf;
}
uint32 card::get_info_location() {
if(overlay_target) {
......
......@@ -217,7 +217,7 @@ public:
static bool card_operation_sort(card* c1, card* c2);
const bool is_extra_deck_monster() { return !!(data.type & (TYPE_FUSION | TYPE_SYNCHRO | TYPE_XYZ | TYPE_LINK)); }
uint32 get_infos(byte* buf, int32 query_flag, int32 use_cache = TRUE);
int32 get_infos(byte* buf, uint32 query_flag, int32 use_cache = TRUE);
uint32 get_info_location();
uint32 second_code(uint32 code);
uint32 get_code();
......
......@@ -238,7 +238,7 @@ extern "C" DECL_DLLEXPORT int32 query_field_count(intptr_t pduel, uint8 playerid
}
return 0;
}
extern "C" DECL_DLLEXPORT int32 query_field_card(intptr_t pduel, uint8 playerid, uint8 location, int32 query_flag, byte* buf, int32 use_cache) {
extern "C" DECL_DLLEXPORT int32 query_field_card(intptr_t pduel, uint8 playerid, uint8 location, uint32 query_flag, byte* buf, int32 use_cache) {
if(playerid != 0 && playerid != 1)
return 0;
duel* ptduel = (duel*)pduel;
......@@ -247,7 +247,7 @@ extern "C" DECL_DLLEXPORT int32 query_field_card(intptr_t pduel, uint8 playerid,
if(location == LOCATION_MZONE) {
for(auto& pcard : player.list_mzone) {
if(pcard) {
uint32 clen = pcard->get_infos(p, query_flag, use_cache);
int32 clen = pcard->get_infos(p, query_flag, use_cache);
p += clen;
} else {
*((int32*)p) = 4;
......@@ -258,7 +258,7 @@ extern "C" DECL_DLLEXPORT int32 query_field_card(intptr_t pduel, uint8 playerid,
else if(location == LOCATION_SZONE) {
for(auto& pcard : player.list_szone) {
if(pcard) {
uint32 clen = pcard->get_infos(p, query_flag, use_cache);
int32 clen = pcard->get_infos(p, query_flag, use_cache);
p += clen;
} else {
*((int32*)p) = 4;
......@@ -281,7 +281,7 @@ extern "C" DECL_DLLEXPORT int32 query_field_card(intptr_t pduel, uint8 playerid,
else
return 0;
for(auto& pcard : *lst) {
uint32 clen = pcard->get_infos(p, query_flag, use_cache);
int32 clen = pcard->get_infos(p, query_flag, use_cache);
p += clen;
}
}
......
......@@ -46,7 +46,7 @@ extern "C" DECL_DLLEXPORT void new_card(intptr_t pduel, uint32 code, uint8 owner
extern "C" DECL_DLLEXPORT void new_tag_card(intptr_t pduel, uint32 code, uint8 owner, uint8 location);
extern "C" DECL_DLLEXPORT int32 query_card(intptr_t pduel, uint8 playerid, uint8 location, uint8 sequence, int32 query_flag, byte* buf, int32 use_cache);
extern "C" DECL_DLLEXPORT int32 query_field_count(intptr_t pduel, uint8 playerid, uint8 location);
extern "C" DECL_DLLEXPORT int32 query_field_card(intptr_t pduel, uint8 playerid, uint8 location, int32 query_flag, byte* buf, int32 use_cache);
extern "C" DECL_DLLEXPORT int32 query_field_card(intptr_t pduel, uint8 playerid, uint8 location, uint32 query_flag, byte* buf, int32 use_cache);
extern "C" DECL_DLLEXPORT int32 query_field_info(intptr_t pduel, byte* buf);
extern "C" DECL_DLLEXPORT void set_responsei(intptr_t pduel, int32 value);
extern "C" DECL_DLLEXPORT void set_responseb(intptr_t pduel, byte* buf);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment