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