Skip to content

Commit

Permalink
Minor updates in duel class
Browse files Browse the repository at this point in the history
  • Loading branch information
edo9300 committed Jun 30, 2023
1 parent ead20f3 commit d5e6766
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 7 deletions.
2 changes: 1 addition & 1 deletion card.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3520,7 +3520,7 @@ int32_t card::is_affect_by_effect(effect* peffect) {
return TRUE;
}
int32_t card::is_can_be_disabled_by_effect(effect* reason_effect, bool is_monster_effect) {
if (is_monster_effect && is_status(STATUS_DISABLED))
if(is_monster_effect && is_status(STATUS_DISABLED))
return FALSE;
if(!is_monster_effect && !(get_type() & TYPE_TRAPMONSTER) && is_status(STATUS_DISABLED))
return FALSE;
Expand Down
4 changes: 2 additions & 2 deletions duel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ void duel::restore_assumes() {
pcard->assume.clear();
assumes.clear();
}
void duel::write_buffer(void* data, size_t size) {
void duel::write_buffer(const void* data, size_t size) {
if(size) {
const auto vec_size = buff.size();
buff.resize(vec_size + size);
Expand Down Expand Up @@ -157,7 +157,7 @@ const card_data& duel::read_card(uint32_t code) {
}
return *ret;
}
duel::duel_message::duel_message(uint8_t _message) :message(_message) {
duel::duel_message::duel_message(uint8_t message) {
write<uint8_t>(message);
}
void duel::duel_message::write(const void* buff, size_t size) {
Expand Down
6 changes: 2 additions & 4 deletions duel.h
Original file line number Diff line number Diff line change
Expand Up @@ -51,9 +51,7 @@ class duel {
}
public:
std::vector<uint8_t> data;
uint8_t message;
duel_message() :message(0) {};
duel_message(uint8_t _message);
explicit duel_message(uint8_t _message);
void write(const void* buff, size_t size);
void write(loc_info loc);
template<typename T, typename T2>
Expand Down Expand Up @@ -105,7 +103,7 @@ class duel {
void release_script_group();
void restore_assumes();
void generate_buffer();
void write_buffer(void* data, size_t size);
void write_buffer(const void* data, size_t size);
void clear_buffer();
void set_response(const void* resp, size_t len);
int32_t get_next_integer(int32_t l, int32_t h);
Expand Down

0 comments on commit d5e6766

Please sign in to comment.