Commit 4f0639dd authored by Chen Bill's avatar Chen Bill

add LEN_EMPTY

parent f54ccda2
......@@ -141,6 +141,7 @@ int32 card::get_infos(byte* buf, uint32 query_flag, int32 use_cache) {
if ((query_flag & QUERY_BASE_ATTACK) || (query_flag & QUERY_BASE_DEFENSE)) {
base_atk_def = get_base_atk_def();
}
//first 8 bytes: data length, query flag
p += 2;
if (query_flag & QUERY_CODE) {
*p = data.code;
......
......@@ -204,8 +204,8 @@ extern "C" DECL_DLLEXPORT int32 query_card(intptr_t pduel, uint8 playerid, uint8
return pcard->get_infos(buf, query_flag, use_cache);
}
else {
*((int32*)buf) = 4;
return 4;
*((int32*)buf) = LEN_EMPTY;
return LEN_EMPTY;
}
}
extern "C" DECL_DLLEXPORT int32 query_field_count(intptr_t pduel, uint8 playerid, uint8 location) {
......@@ -251,8 +251,8 @@ extern "C" DECL_DLLEXPORT int32 query_field_card(intptr_t pduel, uint8 playerid,
int32 clen = pcard->get_infos(p, query_flag, use_cache);
p += clen;
} else {
*((int32*)p) = 4;
p += 4;
*((int32*)p) = LEN_EMPTY;
p += LEN_EMPTY;
}
}
}
......@@ -262,8 +262,8 @@ extern "C" DECL_DLLEXPORT int32 query_field_card(intptr_t pduel, uint8 playerid,
int32 clen = pcard->get_infos(p, query_flag, use_cache);
p += clen;
} else {
*((int32*)p) = 4;
p += 4;
*((int32*)p) = LEN_EMPTY;
p += LEN_EMPTY;
}
}
}
......
......@@ -16,6 +16,8 @@
#define DECL_DLLEXPORT
#endif
#define LEN_EMPTY 4
class card;
struct card_data;
struct card_info;
......
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