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) {
pduel->game_field->effects.cheff.erase(peffect);
if(peffect->is_flag(EFFECT_FLAG_COUNT_LIMIT))
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);
if(cmit != counters.end()) {
pduel->write_buffer8(MSG_REMOVE_COUNTER);
......@@ -2272,7 +2272,6 @@ void card::reset(uint32 id, uint32 reset_type) {
++cmit;
continue;
}
if(cmit->second > 0) {
pduel->write_buffer8(MSG_REMOVE_COUNTER);
pduel->write_buffer16(cmit->first);
pduel->write_buffer8(current.controler);
......@@ -2281,9 +2280,6 @@ void card::reset(uint32 id, uint32 reset_type) {
pduel->write_buffer16(cmit->second);
cmit = counters.erase(cmit);
}
else
++cmit;
}
}
if(id & RESET_TURN_SET) {
#ifdef _IRR_ANDROID_PLATFORM_
......@@ -2486,7 +2482,9 @@ int32 card::add_counter(uint8 playerid, uint16 countertype, uint16 count, uint8
limit = eset.get_last()->get_value();
if(limit) {
int32 mcount = limit - get_counter(cttype);
if (mcount > 0 && pcount > mcount)
if (mcount < 0)
mcount = 0;
if (pcount > mcount)
pcount = mcount;
}
}
......
......@@ -857,7 +857,7 @@ uint32 effect::get_active_type() {
} else
return owner->get_type();
}
int32 effect::get_code_type() {
int32 effect::get_code_type() const {
// start from the highest bit
if (code & 0xf0000000)
return CODE_CUSTOM;
......
......@@ -110,7 +110,7 @@ public:
void set_activate_location();
void set_active_type();
uint32 get_active_type();
int32 get_code_type();
int32 get_code_type() const;
bool is_flag(effect_flag flag) const {
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