command cleanup
changed commands:
strstr haystack needle
now returns position of needle in haystack (counting from 1)
or zero, if not found
substr string start len
now counts negative length from total length
"substr text 1 -2" now returns the text without first and last char
strreplace text search replace
no longer restricted to 260 char stringlengths
removed commands:
swapelements, strpos (can be scripted, if required)
DOCREF strstr substr
DOCREF swapelements strpos
This commit is contained in:
+4
-4
@@ -65,7 +65,7 @@ struct docident
|
||||
struct docsection
|
||||
{
|
||||
char *name;
|
||||
vector<docident *> idents;
|
||||
vector<docident *> sidents;
|
||||
void *menu;
|
||||
|
||||
docsection() : name(NULL) {};
|
||||
@@ -95,7 +95,7 @@ void adddocident(char *name, char *desc)
|
||||
if(!name || !desc || !lastsection || !*name) { lastident = NULL; return; }
|
||||
name = newstring(name);
|
||||
docident &c = docidents[name];
|
||||
lastsection->idents.add(&c);
|
||||
lastsection->sidents.add(&c);
|
||||
c.name = name;
|
||||
c.desc = newstring(desc);
|
||||
lastident = &c;
|
||||
@@ -672,9 +672,9 @@ void renderdocsection(void *menu, bool init)
|
||||
loopv(sections)
|
||||
{
|
||||
if(sections[i].menu != menu) continue;
|
||||
loopvj(sections[i].idents)
|
||||
loopvj(sections[i].sidents)
|
||||
{
|
||||
docident &id = *sections[i].idents[j];
|
||||
docident &id = *sections[i].sidents[j];
|
||||
msection &s = msections.add();
|
||||
s.name = id.name;
|
||||
formatstring(s.cmd)("saycommand [/%s ]", id.name);
|
||||
|
||||
Reference in New Issue
Block a user