Commit 14ebfd50 authored by nanahira's avatar nanahira

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

parents 8a44abb6 57557b86
...@@ -548,8 +548,8 @@ inline effect_flag operator|(effect_flag flag1, effect_flag flag2) ...@@ -548,8 +548,8 @@ inline effect_flag operator|(effect_flag flag1, effect_flag flag2)
#define EVENT_REMOVE_COUNTER 0x20000 #define EVENT_REMOVE_COUNTER 0x20000
#define EVENT_CUSTOM 0x10000000 #define EVENT_CUSTOM 0x10000000
#define DOUBLE_DAMAGE 0x80000000 constexpr int32 DOUBLE_DAMAGE = 0x80000000;
#define HALF_DAMAGE 0x80000001 constexpr int32 HALF_DAMAGE = 0x80000001;
// flag effect // flag effect
#define EFFECT_FLAG_EFFECT 0x20000000 #define EFFECT_FLAG_EFFECT 0x20000000
......
...@@ -393,6 +393,10 @@ int32 scriptlib::group_is_exists(lua_State *L) { ...@@ -393,6 +393,10 @@ int32 scriptlib::group_is_exists(lua_State *L) {
uint32 extraargs = lua_gettop(L) - 4; uint32 extraargs = lua_gettop(L) - 4;
uint32 fcount = 0; uint32 fcount = 0;
uint32 result = FALSE; uint32 result = FALSE;
if (count > pgroup->container.size()) {
lua_pushboolean(L, 0);
return 1;
}
for (auto& pcard : cset) { for (auto& pcard : cset) {
if(pduel->lua->check_matching(pcard, 2, extraargs)) { if(pduel->lua->check_matching(pcard, 2, extraargs)) {
++fcount; ++fcount;
...@@ -721,11 +725,12 @@ int32 scriptlib::group_search_card(lua_State *L) { ...@@ -721,11 +725,12 @@ int32 scriptlib::group_search_card(lua_State *L) {
group* pgroup = *(group**) lua_touserdata(L, 1); group* pgroup = *(group**) lua_touserdata(L, 1);
duel* pduel = pgroup->pduel; duel* pduel = pgroup->pduel;
uint32 extraargs = lua_gettop(L) - 2; uint32 extraargs = lua_gettop(L) - 2;
for(auto& pcard : pgroup->container) for (auto& pcard : pgroup->container) {
if(pduel->lua->check_matching(pcard, 2, extraargs)) { if (pduel->lua->check_matching(pcard, 2, extraargs)) {
interpreter::card2value(L, pcard); interpreter::card2value(L, pcard);
return 1; return 1;
} }
}
return 0; return 0;
} }
int32 scriptlib::group_get_bin_class_count(lua_State *L) { int32 scriptlib::group_get_bin_class_count(lua_State *L) {
......
...@@ -589,7 +589,10 @@ int32 field::recover(uint16 step, effect* reason_effect, uint32 reason, uint8 re ...@@ -589,7 +589,10 @@ int32 field::recover(uint16 step, effect* reason_effect, uint32 reason, uint8 re
if(reason & REASON_RDAMAGE) if(reason & REASON_RDAMAGE)
core.units.begin()->step = 2; core.units.begin()->step = 2;
core.hint_timing[playerid] |= TIMING_RECOVER; core.hint_timing[playerid] |= TIMING_RECOVER;
int32 limit = INT32_MAX - player[playerid].lp; int32 limit = 0;
if (player[playerid].lp > 0) {
limit = INT32_MAX - player[playerid].lp;
}
int32 val = amount; int32 val = amount;
if (val > limit) { if (val > limit) {
val = limit; val = limit;
......
This diff is collapsed.
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