Project

General

Profile

Bug #1457 » 0027-Lua-Remove-duplicate-action-finder-methods.patch

S3_3 - Marko Lindqvist, 11/29/2025 05:35 PM

View differences:

common/scriptcore/api_game_find.c
return nation_by_rule_name(name_orig);
}
/**********************************************************************//**
Return the action type with the given action_id number.
**************************************************************************/
Action *api_find_action(lua_State *L, action_id act_id)
{
LUASCRIPT_CHECK_STATE(L, NULL);
return action_by_number(act_id);
}
/**********************************************************************//**
Return the action with the given name_orig.
**************************************************************************/
Action *api_find_action_by_name(lua_State *L, const char *name_orig)
{
LUASCRIPT_CHECK_STATE(L, NULL);
LUASCRIPT_CHECK_ARG_NIL(L, name_orig, 2, string, NULL);
return action_by_rule_name(name_orig);
}
/**********************************************************************//**
Return the improvement type with the given impr_type_id index.
**************************************************************************/
common/scriptcore/api_game_find.h
Nation_Type *api_find_nation_type(lua_State *L, int nation_type_id);
Nation_Type *api_find_nation_type_by_name(lua_State *L,
const char *name_orig);
Action *api_find_action(lua_State *L, action_id act_id);
Action *api_find_action_by_name(lua_State *L, const char *name_orig);
Building_Type *api_find_building_type(lua_State *L, int building_type_id);
Building_Type *api_find_building_type_by_name(lua_State *L,
const char *name_orig);
common/scriptcore/tolua_game.pkg
@ nation_type (lua_State *L, const char *name_orig);
Nation_Type *api_find_nation_type
@ nation_type (lua_State *L, int nation_type_id);
Action *api_find_action_by_name
@ action (lua_State *L, const char *name_orig);
Action *api_find_action
@ action (lua_State *L, int action_type_id);
Building_Type *api_find_building_type_by_name
@ building_type (lua_State *L, const char *name_orig);
Building_Type *api_find_building_type
(2-2/2)