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
+2 -1
View File
@@ -520,6 +520,7 @@ docremark [If I is 4 you get a string representing the current state of the peer
docexample [echo [I am (curserver 4) to (curserver 2)]] [Output: I am connected to ctf-only.assault-servers.net];
docexample [last_server = "" remember_server = [ if (strcmp (curserver 4) "connected") [ last_server = (curserver 0) echo "I'm remembering:" $last_server ] [ echo "you are not 'connected' - you" (concatword "are '" (curserver 4) "' !") ] ] bind PRINT [ if (strcmp $last_server "") [ remember_server ] [ say (concat "^L2I was just ^Lfon^L3" $last_server) last_server = "" ] ]] [This will either remember or retrieve the last server you pressed the PrintScreen-key on.];
docident [curteam] [Returns 1 if the local player is on the RVSF team, 0 if on CLA.];
docargument [C] [optional argument: client number] [] [0];
docident [curweapon] [Returns the weapon-index the local player is currently holding.];
docident [demo] [Plays a recorded demo.];
docargument [S] [the demo name] [] [0];
@@ -731,7 +732,7 @@ docargument [M] [mode] [1 or 2] [0];
docargument [T] [time (in minutes)] [1-60] [0];
docremark [The first argument "M" needs to be 1 for setting the FFA-timeout or 2 for the Team-Mode-timeout.];
docident [isclient] [Determines if the client number given is a valid client "(player)".];
docargument [C] [client number [] [0];
docargument [C] [client number] [] [0];
docexample [echo (isclient 0)] [Example output: 1];
docexample [echo (isclient 32)] [Example output: 0];
docsection [Editing]
+1 -1
View File
@@ -2420,7 +2420,7 @@ bind PRINT [ if (strcmp $last_server "") [ remember_server ]
<command name="curteam">
<description>Returns 1 if the local player is on the RVSF team, 0 if on CLA. If the player is in SPECTATOR it returns 2.</description>
<arguments>
<argument token="C" description="optional argument: client number" valueNotes="returns the specified client's cn instead"/>
<argument token="C" description="optional argument: client number" valueNotes="returns the specified client's team instead"/>
</arguments>
<references>
<identifierReference identifier="team"/>
+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");