Changed CreateUnit to use a table for the location
This commit is contained in:
parent
25260f36bc
commit
dcf44949c6
1 changed files with 10 additions and 3 deletions
|
@ -1028,15 +1028,22 @@ local int CclCreateUnit(lua_State* l)
|
|||
int ix;
|
||||
int iy;
|
||||
|
||||
if (lua_gettop(l) != 4) {
|
||||
if (lua_gettop(l) != 3) {
|
||||
LuaError(l, "incorrect argument");
|
||||
}
|
||||
|
||||
lua_pushvalue(l, 1);
|
||||
unittype = CclGetUnitType(l);
|
||||
lua_pop(l, 1);
|
||||
ix = LuaToNumber(l, 3);
|
||||
iy = LuaToNumber(l, 4);
|
||||
if (!lua_istable(l, 3) || luaL_getn(l, 3) != 2) {
|
||||
LuaError(l, "incorrect argument");
|
||||
}
|
||||
lua_rawgeti(l, 3, 1);
|
||||
ix = LuaToNumber(l, -1);
|
||||
lua_pop(l, 1);
|
||||
lua_rawgeti(l, 3, 2);
|
||||
iy = LuaToNumber(l, -1);
|
||||
lua_pop(l, 1);
|
||||
|
||||
heading = SyncRand() % 256;
|
||||
lua_pushvalue(l, 2);
|
||||
|
|
Loading…
Add table
Reference in a new issue