Skip to content

Commit

Permalink
scriptlib: rename to is_effect_has_property (#659)
Browse files Browse the repository at this point in the history
effect::code is not a bit field.
  • Loading branch information
salix5 authored Nov 14, 2024
1 parent 4047c1a commit 12f93a2
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 8 deletions.
11 changes: 4 additions & 7 deletions libeffect.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ int32 scriptlib::get_effect_property(lua_State* L, effect_member type) {
lua_pushinteger(L, value);
return 1;
}
int32 scriptlib::is_effect_property(lua_State* L, effect_member type) {
int32 scriptlib::is_effect_has_property(lua_State* L, effect_member type) {
check_param_count(L, 2);
check_param(L, PARAM_TYPE_EFFECT, 1);
effect* peffect = *(effect**)lua_touserdata(L, 1);
Expand All @@ -52,9 +52,6 @@ int32 scriptlib::is_effect_property(lua_State* L, effect_member type) {
case MEMBER_CATEGORY:
value = peffect->category;
break;
case MEMBER_CODE:
value = peffect->code;
break;
case MEMBER_RANGE:
value = peffect->range;
break;
Expand Down Expand Up @@ -519,13 +516,13 @@ int32 scriptlib::effect_is_has_property(lua_State *L) {
return 1;
}
int32 scriptlib::effect_is_has_category(lua_State *L) {
return is_effect_property(L, MEMBER_CATEGORY);
return is_effect_has_property(L, MEMBER_CATEGORY);
}
int32 scriptlib::effect_is_has_type(lua_State *L) {
return is_effect_property(L, MEMBER_TYPE);
return is_effect_has_property(L, MEMBER_TYPE);
}
int32 scriptlib::effect_is_has_range(lua_State* L) {
return is_effect_property(L, MEMBER_RANGE);
return is_effect_has_property(L, MEMBER_RANGE);
}
int32 scriptlib::effect_is_activatable(lua_State *L) {
check_param_count(L, 2);
Expand Down
2 changes: 1 addition & 1 deletion scriptlib.h
Original file line number Diff line number Diff line change
Expand Up @@ -310,7 +310,7 @@ class scriptlib {

//Effect functions
static int32 get_effect_property(lua_State* L, effect_member type);
static int32 is_effect_property(lua_State* L, effect_member type);
static int32 is_effect_has_property(lua_State* L, effect_member type);
static int32 effect_new(lua_State *L);
static int32 effect_newex(lua_State *L);
static int32 effect_clone(lua_State *L);
Expand Down

0 comments on commit 12f93a2

Please sign in to comment.