Commit 28b736a9 authored by mercury233's avatar mercury233

fix effect_set_category

parent 2185e226
...@@ -271,8 +271,11 @@ int32_t scriptlib::effect_set_category(lua_State *L) { ...@@ -271,8 +271,11 @@ int32_t scriptlib::effect_set_category(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_t v = (uint32_t)lua_tointeger(L, 2); int64_t v = lua_tointeger(L, 2);
peffect->category = v; if(v < 0) {
return luaL_error(L, "Parameter 2 should be non-negative.");
}
peffect->category = (uint64_t)v;
return 0; return 0;
} }
int32_t scriptlib::effect_set_hint_timing(lua_State *L) { int32_t scriptlib::effect_set_hint_timing(lua_State *L) {
......
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