Commit 4bdb7361 authored by salix5's avatar salix5

fix warning C6011

parent 29ff1257
......@@ -43,9 +43,10 @@ bool card::card_operation_sort(card* c1, card* c2) {
if(c1->current.location != c2->current.location)
return c1->current.location < c2->current.location;
if(c1->current.location & LOCATION_OVERLAY) {
if(c1->overlay_target->current.sequence != c2->overlay_target->current.sequence)
if(c1->overlay_target && c2->overlay_target && c1->overlay_target->current.sequence != c2->overlay_target->current.sequence)
return c1->overlay_target->current.sequence < c2->overlay_target->current.sequence;
else return c1->current.sequence < c2->current.sequence;
else
return c1->current.sequence < c2->current.sequence;
} else {
if(c1->current.location & (LOCATION_DECK | LOCATION_EXTRA | LOCATION_GRAVE | LOCATION_REMOVED))
return c1->current.sequence > c2->current.sequence;
......
......@@ -265,7 +265,7 @@ extern "C" DECL_DLLEXPORT int32 query_field_card(ptr pduel, uint8 playerid, uint
}
}
else {
field::card_vector* lst = 0;
field::card_vector* lst = nullptr;
if(location == LOCATION_HAND)
lst = &player.list_hand;
else if(location == LOCATION_GRAVE)
......@@ -276,6 +276,8 @@ extern "C" DECL_DLLEXPORT int32 query_field_card(ptr pduel, uint8 playerid, uint
lst = &player.list_extra;
else if(location == LOCATION_DECK)
lst = &player.list_main;
else
return 0;
for(auto& pcard : *lst) {
uint32 clen = pcard->get_infos(p, query_flag, use_cache);
p += clen;
......
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