Commit c877962a authored by mercury233's avatar mercury233 Committed by nanahira

change announcecard behavior (#156)

parent 26bc4737
......@@ -1010,23 +1010,27 @@ int32 field::announce_card(int16 step, uint8 playerid, uint32 ttype) {
return FALSE;
} else {
int32 code = returns.ivalue[0];
bool retry = false;
card_data data;
read_card(code, &data);
if(!data.code) {
pduel->write_buffer8(MSG_RETRY);
return FALSE;
}
if(core.select_options.size() == 0) {
retry = true;
} else if(core.select_options.size() == 0) {
if(!(data.type & ttype)) {
pduel->write_buffer8(MSG_RETRY);
return FALSE;
retry = true;
}
} else {
if(!is_declarable(data, core.select_options)) {
pduel->write_buffer8(MSG_RETRY);
return FALSE;
retry = true;
}
}
if(retry) {
pduel->write_buffer8(MSG_HINT);
pduel->write_buffer8(HINT_MESSAGE);
pduel->write_buffer8(playerid);
pduel->write_buffer32(1421);
return announce_card(0, playerid, ttype);
}
pduel->write_buffer8(MSG_HINT);
pduel->write_buffer8(HINT_CODE);
pduel->write_buffer8(playerid);
......
......@@ -601,7 +601,8 @@ int32 field::process() {
pduel->lua->add_param(returns.ivalue[0], PARAM_TYPE_INT);
core.units.pop_front();
} else {
it->step++;
if(it->step == 0)
it->step++;
}
return PROCESSOR_WAITING + pduel->bufferlen;
}
......
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