Commit 3236cd8d authored by nekrozar's avatar nekrozar Committed by DailyShana

fix (#82)

parent ee16ca74
......@@ -1789,7 +1789,7 @@ int32 scriptlib::card_is_onfield(lua_State *L) {
check_param_count(L, 1);
check_param(L, PARAM_TYPE_CARD, 1);
card* pcard = *(card**) lua_touserdata(L, 1);
if((pcard->current.location & LOCATION_ONFIELD)
if((pcard->current.location & LOCATION_ONFIELD)
&& !pcard->get_status(STATUS_SUMMONING | STATUS_SUMMON_DISABLED | STATUS_ACTIVATE_DISABLED | STATUS_SPSUMMON_STEP))
lua_pushboolean(L, 1);
else
......@@ -1828,7 +1828,7 @@ int32 scriptlib::card_is_level_below(lua_State *L) {
check_param(L, PARAM_TYPE_CARD, 1);
card* pcard = *(card**) lua_touserdata(L, 1);
uint32 lvl = lua_tointeger(L, 2);
if((pcard->data.type & TYPE_XYZ) || (pcard->status & STATUS_NO_LEVEL)
if((pcard->data.type & (TYPE_XYZ | TYPE_LINK)) || (pcard->status & STATUS_NO_LEVEL)
|| (!(pcard->data.type & TYPE_MONSTER) && !(pcard->get_type() & TYPE_MONSTER) && !(pcard->current.location & LOCATION_MZONE)))
lua_pushboolean(L, 0);
else
......@@ -1840,7 +1840,7 @@ int32 scriptlib::card_is_level_above(lua_State *L) {
check_param(L, PARAM_TYPE_CARD, 1);
card* pcard = *(card**) lua_touserdata(L, 1);
uint32 lvl = lua_tointeger(L, 2);
if((pcard->data.type & TYPE_XYZ) || (pcard->status & STATUS_NO_LEVEL)
if((pcard->data.type & (TYPE_XYZ | TYPE_LINK)) || (pcard->status & STATUS_NO_LEVEL)
|| (!(pcard->data.type & TYPE_MONSTER) && !(pcard->get_type() & TYPE_MONSTER) && !(pcard->current.location & LOCATION_MZONE)))
lua_pushboolean(L, 0);
else
......@@ -1902,7 +1902,7 @@ int32 scriptlib::card_is_defense_below(lua_State *L) {
check_param(L, PARAM_TYPE_CARD, 1);
card* pcard = *(card**) lua_touserdata(L, 1);
int32 def = lua_tointeger(L, 2);
if(!(pcard->data.type & TYPE_MONSTER) && !(pcard->get_type() & TYPE_MONSTER) && !(pcard->current.location & LOCATION_MZONE))
if((pcard->data.type & TYPE_LINK) || (!(pcard->data.type & TYPE_MONSTER) && !(pcard->get_type() & TYPE_MONSTER) && !(pcard->current.location & LOCATION_MZONE)))
lua_pushboolean(L, 0);
else {
int32 _def = pcard->get_defense();
......@@ -1915,7 +1915,7 @@ int32 scriptlib::card_is_defense_above(lua_State *L) {
check_param(L, PARAM_TYPE_CARD, 1);
card* pcard = *(card**) lua_touserdata(L, 1);
int32 def = lua_tointeger(L, 2);
if(!(pcard->data.type & TYPE_MONSTER) && !(pcard->get_type() & TYPE_MONSTER) && !(pcard->current.location & LOCATION_MZONE))
if((pcard->data.type & TYPE_LINK) || (!(pcard->data.type & TYPE_MONSTER) && !(pcard->get_type() & TYPE_MONSTER) && !(pcard->current.location & LOCATION_MZONE)))
lua_pushboolean(L, 0);
else {
int32 _def = pcard->get_defense();
......@@ -2016,7 +2016,7 @@ int32 scriptlib::card_enable_counter_permit(lua_State *L) {
card* pcard = *(card**) lua_touserdata(L, 1);
int32 countertype = lua_tointeger(L, 2);
uint32 prange;
if(lua_gettop(L) > 2)
if(lua_gettop(L) > 2)
prange = lua_tointeger(L, 3);
else if(pcard->data.type & TYPE_MONSTER)
prange = LOCATION_MZONE;
......
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