expose selecting a single unit to lua

This commit is contained in:
Tim Felgentreff 2015-10-28 14:23:23 +01:00
parent c8b935b322
commit d819adf949

View file

@ -1202,6 +1202,18 @@ static int CclSlotUsage(lua_State *l)
return 0;
}
static int CclSelectSingleUnit(lua_State *l)
{
const int nargs = lua_gettop(l);
Assert(nargs == 1);
lua_pushvalue(l, 1);
CUnit *unit = CclGetUnit(l);
lua_pop(l, 1);
SelectSingleUnit(*unit);
SelectionChanged();
return 0;
}
/**
** Register CCL features for unit.
*/
@ -1234,6 +1246,8 @@ void UnitCclRegister()
lua_register(Lua, "SetUnitVariable", CclSetUnitVariable);
lua_register(Lua, "SlotUsage", CclSlotUsage);
lua_register(Lua, "SelectSingleUnit", CclSelectSingleUnit);
}
//@}