Use new coding style in game modules

Lots of refactoring and changes
Remove docs folder
This commit is contained in:
Eduardo Bart
2012-07-24 02:30:08 -03:00
parent 1c3e630237
commit c54cd1fdf1
69 changed files with 1629 additions and 2634 deletions

View File

@@ -930,18 +930,21 @@ void LuaInterface::setTable(int index)
void LuaInterface::clearTable(int index)
{
assert(hasIndex(index) && isTable(index));
pushNil();
pushNil(); // table, nil
bool stop = false;
while(!stop && next(index-1)) {
pop();
pushValue();
if(next(index-2))
pop();
else
stop = true;
insert(-2);
pushNil();
rawSet(index-3);
while(next(index-1)) { // table, key, value
pop(); // table, key
pushValue(); // table, key, key
if(next(index-2)) { // table, key, nextkey, value
pop(); // table, key, nextkey
insert(-2); // table, nextkey, key
pushNil(); // table, nextkey, key, nil
rawSet(index-3); // table, nextkey
} else { // table, key
pushNil(); // table, key, nil
rawSet(index-2); // table
break;
}
}
}