Commit 1d702709 authored by nanahira's avatar nanahira

Merge branch 'master' of github.com:Fluorohydride/ygopro-core into develop

parents 94f4763d b16497d3
...@@ -2109,7 +2109,7 @@ void card::remove_effect(effect* peffect, effect_container::iterator it) { ...@@ -2109,7 +2109,7 @@ void card::remove_effect(effect* peffect, effect_container::iterator it) {
pduel->game_field->effects.cheff.erase(peffect); pduel->game_field->effects.cheff.erase(peffect);
if(peffect->is_flag(EFFECT_FLAG_COUNT_LIMIT)) if(peffect->is_flag(EFFECT_FLAG_COUNT_LIMIT))
pduel->game_field->effects.rechargeable.erase(peffect); pduel->game_field->effects.rechargeable.erase(peffect);
if(((peffect->code & 0xf0000) == EFFECT_COUNTER_PERMIT) && (peffect->type & EFFECT_TYPE_SINGLE)) { if(peffect->get_code_type() == CODE_COUNTER && (peffect->code & 0xf0000) == EFFECT_COUNTER_PERMIT && (peffect->type & EFFECT_TYPE_SINGLE)) {
auto cmit = counters.find(peffect->code & 0xffff); auto cmit = counters.find(peffect->code & 0xffff);
if(cmit != counters.end()) { if(cmit != counters.end()) {
pduel->write_buffer8(MSG_REMOVE_COUNTER); pduel->write_buffer8(MSG_REMOVE_COUNTER);
...@@ -2272,17 +2272,13 @@ void card::reset(uint32 id, uint32 reset_type) { ...@@ -2272,17 +2272,13 @@ void card::reset(uint32 id, uint32 reset_type) {
++cmit; ++cmit;
continue; continue;
} }
if(cmit->second > 0) { pduel->write_buffer8(MSG_REMOVE_COUNTER);
pduel->write_buffer8(MSG_REMOVE_COUNTER); pduel->write_buffer16(cmit->first);
pduel->write_buffer16(cmit->first); pduel->write_buffer8(current.controler);
pduel->write_buffer8(current.controler); pduel->write_buffer8(current.location);
pduel->write_buffer8(current.location); pduel->write_buffer8(current.sequence);
pduel->write_buffer8(current.sequence); pduel->write_buffer16(cmit->second);
pduel->write_buffer16(cmit->second); cmit = counters.erase(cmit);
cmit = counters.erase(cmit);
}
else
++cmit;
} }
} }
if(id & RESET_TURN_SET) { if(id & RESET_TURN_SET) {
...@@ -2486,7 +2482,9 @@ int32 card::add_counter(uint8 playerid, uint16 countertype, uint16 count, uint8 ...@@ -2486,7 +2482,9 @@ int32 card::add_counter(uint8 playerid, uint16 countertype, uint16 count, uint8
limit = eset.get_last()->get_value(); limit = eset.get_last()->get_value();
if(limit) { if(limit) {
int32 mcount = limit - get_counter(cttype); int32 mcount = limit - get_counter(cttype);
if (mcount > 0 && pcount > mcount) if (mcount < 0)
mcount = 0;
if (pcount > mcount)
pcount = mcount; pcount = mcount;
} }
} }
......
...@@ -857,7 +857,7 @@ uint32 effect::get_active_type() { ...@@ -857,7 +857,7 @@ uint32 effect::get_active_type() {
} else } else
return owner->get_type(); return owner->get_type();
} }
int32 effect::get_code_type() { int32 effect::get_code_type() const {
// start from the highest bit // start from the highest bit
if (code & 0xf0000000) if (code & 0xf0000000)
return CODE_CUSTOM; return CODE_CUSTOM;
......
...@@ -110,7 +110,7 @@ public: ...@@ -110,7 +110,7 @@ public:
void set_activate_location(); void set_activate_location();
void set_active_type(); void set_active_type();
uint32 get_active_type(); uint32 get_active_type();
int32 get_code_type(); int32 get_code_type() const;
bool is_flag(effect_flag flag) const { bool is_flag(effect_flag flag) const {
return !!(this->flag[0] & flag); return !!(this->flag[0] & flag);
......
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