mirror of
https://github.com/glest/glest-source.git
synced 2025-08-21 15:41:24 +02:00
- added some more lua commands:
vector<int> getUnitsForFaction(factionIndex,commandTypeName, field) int getUnitCurrentField(unitId)
This commit is contained in:
@@ -80,6 +80,7 @@ public:
|
||||
void returnInt(int value);
|
||||
void returnString(const string &value);
|
||||
void returnVec2i(const Vec2i &value);
|
||||
void returnVectorInt(const vector<int> &value);
|
||||
|
||||
private:
|
||||
void throwLuaError(const string &message) const;
|
||||
|
@@ -614,6 +614,19 @@ void LuaArguments::returnVec2i(const Vec2i &value){
|
||||
lua_rawseti(luaState, -2, 2);
|
||||
}
|
||||
|
||||
void LuaArguments::returnVectorInt(const vector<int> &value) {
|
||||
//Lua_STREFLOP_Wrapper streflopWrapper;
|
||||
|
||||
++returnCount;
|
||||
|
||||
lua_newtable(luaState);
|
||||
|
||||
for(unsigned int i = 0; i < value.size(); ++i) {
|
||||
lua_pushnumber(luaState, value[i]);
|
||||
lua_rawseti(luaState, -2, i+1);
|
||||
}
|
||||
}
|
||||
|
||||
void LuaArguments::throwLuaError(const string &message) const{
|
||||
Lua_STREFLOP_Wrapper streflopWrapper;
|
||||
|
||||
|
Reference in New Issue
Block a user