docs.cfg fix, reference.xml curteam entry, persisting constants support

git-svn-id: svn://svn.code.sf.net/p/actiongame/code/trunk/ac@6579 e016b1c5-ed68-44aa-a2f7-31cac88cffde
This commit is contained in:
Lucas GAUTHERON
2011-08-16 12:09:37 +00:00
parent 5006187690
commit dbca100335
3 changed files with 19 additions and 4 deletions
+16 -2
View File
@@ -156,8 +156,15 @@ void constant(const char *name, const char *action)
ident b(ID_ALIAS, newstring(name), newstring(action), persistidents, execcontext);
b.isconst = true;
idents->access(b.name, b);
return;
}
else if(b->type==ID_ALIAS)
if(b->isconst)
{
conoutf("%s is already defined as a constant", b->name);
scripterr();
return;
}
if(b->type==ID_ALIAS)
{
if(contextisolated[execcontext] && execcontext > b->context)
{
@@ -1399,7 +1406,14 @@ void writecfg()
enumerate(*idents, ident, id,
if(id.type==ID_ALIAS && id.persist && id.action[0])
{
f->printf("%s = [%s]\n", id.name, id.action);
if(id.isconst)
{
f->printf("const %s %s\n", id.name, id.action);
}
else
{
f->printf("%s = [%s]\n", id.name, id.action);
}
}
);
f->printf("\n");