Skip to content

Commit

Permalink
Debug.AddCard, properly add card as overlayed material even for cards…
Browse files Browse the repository at this point in the history
… in spell/trap zone, updated MSG_RELOAD_FIELD accordingly
  • Loading branch information
edo9300 committed Jan 16, 2020
1 parent 8bdd15c commit 735526d
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 11 deletions.
1 change: 1 addition & 0 deletions field.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -140,6 +140,7 @@ void field::reload_field_info() {
if(pcard) {
message->write<uint8>(1);
message->write<uint8>(pcard->current.position);
message->write<uint32>(pcard->xyz_materials.size());
} else {
message->write<uint8>(0);
}
Expand Down
2 changes: 1 addition & 1 deletion libdebug.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ int32 scriptlib::debug_add_card(lua_State *L) {
pcard->set_status(STATUS_PROC_COMPLETE, TRUE);
interpreter::card2value(L, pcard);
return 1;
} else if(location == LOCATION_MZONE) {
} else if(location & LOCATION_ONFIELD) {
card* pcard = pduel->new_card(code);
pcard->owner = owner;
card* fcard = pduel->game_field->get_field_card(playerid, location, sequence);
Expand Down
19 changes: 10 additions & 9 deletions ocgapi.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,7 @@ OCGAPI uint32_t OCG_DuelQueryCount(OCG_Duel duel, uint8_t team, uint32_t loc) {
return player.list_extra.size();
if(loc == LOCATION_DECK)
return player.list_main.size();
uint32 count = 0;
uint32_t count = 0;
if(loc == LOCATION_MZONE) {
for(auto& pcard : player.list_mzone)
if(pcard) count++;
Expand Down Expand Up @@ -276,6 +276,7 @@ OCGAPI void * OCG_DuelQueryField(OCG_Duel duel, uint32_t * length) {
if(pcard) {
insert_value<int8_t>(query, 1);
insert_value<int8_t>(query, pcard->current.position);
insert_value<int32_t>(query, pcard->xyz_materials.size());
} else {
insert_value<int8_t>(query, 0);
}
Expand All @@ -292,14 +293,14 @@ OCGAPI void * OCG_DuelQueryField(OCG_Duel duel, uint32_t * length) {
effect* peffect = ch.triggering_effect;
insert_value<int32_t>(query, peffect->get_handler()->data.code);
loc_info info = peffect->get_handler()->get_info_location();
insert_value<uint8>(query, info.controler);
insert_value<uint8>(query, info.location);
insert_value<uint32>(query, info.sequence);
insert_value<uint32>(query, info.position);
insert_value<uint8>(query, ch.triggering_controler);
insert_value<uint8>(query, (uint8)ch.triggering_location);
insert_value<uint32>(query, ch.triggering_sequence);
insert_value<uint64>(query, peffect->description);
insert_value<uint8_t>(query, info.controler);
insert_value<uint8_t>(query, info.location);
insert_value<uint32_t>(query, info.sequence);
insert_value<uint32_t>(query, info.position);
insert_value<uint8_t>(query, ch.triggering_controler);
insert_value<uint8_t>(query, (uint8_t)ch.triggering_location);
insert_value<uint32_t>(query, ch.triggering_sequence);
insert_value<uint64_t>(query, peffect->description);
}
if(length)
*length = query.size();
Expand Down
2 changes: 1 addition & 1 deletion ocgapi_types.h
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
#include <stdint.h>

#define OCG_VERSION_MAJOR 5
#define OCG_VERSION_MINOR 0
#define OCG_VERSION_MINOR 1

typedef enum OCG_LogTypes {
OCG_LOG_TYPE_ERROR,
Expand Down

0 comments on commit 735526d

Please sign in to comment.