Commit be2229da authored by salix5's avatar salix5

lua_tounsigned

parent 72c9b888
...@@ -512,7 +512,7 @@ int32 scriptlib::card_is_status(lua_State *L) { ...@@ -512,7 +512,7 @@ int32 scriptlib::card_is_status(lua_State *L) {
check_param_count(L, 2); check_param_count(L, 2);
check_param(L, PARAM_TYPE_CARD, 1); check_param(L, PARAM_TYPE_CARD, 1);
card* pcard = *(card**) lua_touserdata(L, 1); card* pcard = *(card**) lua_touserdata(L, 1);
uint32 tstatus = lua_tointeger(L, 2); uint32 tstatus = lua_tounsigned(L, 2);
if(pcard->status & tstatus) if(pcard->status & tstatus)
lua_pushboolean(L, 1); lua_pushboolean(L, 1);
else else
...@@ -536,7 +536,7 @@ int32 scriptlib::card_set_status(lua_State *L) { ...@@ -536,7 +536,7 @@ int32 scriptlib::card_set_status(lua_State *L) {
card* pcard = *(card**) lua_touserdata(L, 1); card* pcard = *(card**) lua_touserdata(L, 1);
if(pcard->status & STATUS_COPYING_EFFECT) if(pcard->status & STATUS_COPYING_EFFECT)
return 0; return 0;
uint32 tstatus = lua_tointeger(L, 2); uint32 tstatus = lua_tounsigned(L, 2);
int32 enable = lua_toboolean(L, 3); int32 enable = lua_toboolean(L, 3);
pcard->set_status(tstatus, enable); pcard->set_status(tstatus, enable);
return 0; return 0;
......
...@@ -188,7 +188,7 @@ int32 scriptlib::effect_set_property(lua_State *L) { ...@@ -188,7 +188,7 @@ int32 scriptlib::effect_set_property(lua_State *L) {
check_param_count(L, 2); check_param_count(L, 2);
check_param(L, PARAM_TYPE_EFFECT, 1); check_param(L, PARAM_TYPE_EFFECT, 1);
effect* peffect = *(effect**) lua_touserdata(L, 1); effect* peffect = *(effect**) lua_touserdata(L, 1);
int32 v = lua_tointeger(L, 2); uint32 v = lua_tounsigned(L, 2);
peffect->flag |= v & 0xfffffff0; peffect->flag |= v & 0xfffffff0;
return 0; return 0;
} }
...@@ -340,7 +340,7 @@ int32 scriptlib::effect_get_property(lua_State *L) { ...@@ -340,7 +340,7 @@ int32 scriptlib::effect_get_property(lua_State *L) {
check_param(L, PARAM_TYPE_EFFECT, 1); check_param(L, PARAM_TYPE_EFFECT, 1);
effect* peffect = *(effect**) lua_touserdata(L, 1); effect* peffect = *(effect**) lua_touserdata(L, 1);
if (peffect) { if (peffect) {
lua_pushinteger(L, peffect->flag); lua_pushunsigned(L, peffect->flag);
return 1; return 1;
} }
return 0; return 0;
...@@ -488,7 +488,7 @@ int32 scriptlib::effect_is_has_property(lua_State *L) { ...@@ -488,7 +488,7 @@ int32 scriptlib::effect_is_has_property(lua_State *L) {
check_param_count(L, 2); check_param_count(L, 2);
check_param(L, PARAM_TYPE_EFFECT, 1); check_param(L, PARAM_TYPE_EFFECT, 1);
effect* peffect = *(effect**) lua_touserdata(L, 1); effect* peffect = *(effect**) lua_touserdata(L, 1);
uint32 tflag = lua_tointeger(L, 2); uint32 tflag = lua_tounsigned(L, 2);
if (peffect && (peffect->flag & tflag)) if (peffect && (peffect->flag & tflag))
lua_pushboolean(L, 1); lua_pushboolean(L, 1);
else else
......
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