mirror of
https://github.com/wesnoth/wesnoth
synced 2025-05-03 08:43:48 +00:00
Split code a bit.
This commit is contained in:
parent
a0cc796cfa
commit
5fd50fea13
@ -113,6 +113,17 @@ static void chat_message(std::string const &caption, std::string const &msg)
|
||||
events::chat_handler::MESSAGE_PUBLIC, false);
|
||||
}
|
||||
|
||||
/**
|
||||
* Pushes a config as a volatile vconfig on the top of the stack.
|
||||
*/
|
||||
static void luaW_pushvconfig(lua_State *L, config const &cfg)
|
||||
{
|
||||
new(lua_newuserdata(L, sizeof(vconfig))) vconfig(cfg, true);
|
||||
lua_pushlightuserdata(L, (void *)&vconfigKey);
|
||||
lua_rawget(L, LUA_REGISTRYINDEX);
|
||||
lua_setmetatable(L, -2);
|
||||
}
|
||||
|
||||
/**
|
||||
* Pushes a t_string on the top of the stack.
|
||||
*/
|
||||
@ -966,10 +977,7 @@ static int cfun_wml_action_proxy(lua_State *L)
|
||||
config cfg;
|
||||
if (!luaW_toconfig(L, 1, cfg))
|
||||
goto error_call_destructors;
|
||||
new(lua_newuserdata(L, sizeof(vconfig))) vconfig(cfg, true);
|
||||
lua_pushlightuserdata(L, (void *)&vconfigKey);
|
||||
lua_rawget(L, LUA_REGISTRYINDEX);
|
||||
lua_setmetatable(L, -2);
|
||||
luaW_pushvconfig(L, cfg);
|
||||
break;
|
||||
}
|
||||
case LUA_TUSERDATA:
|
||||
|
Loading…
x
Reference in New Issue
Block a user