Kommandos: ggf IDs an _process_command() uebergeben
Durch Uebergabe der Kommando-ID (aus AddCmd-Aufruf) koennen
Kommandos selektiv durch Ueberschreiben der
_process_command() identifiziert und abgebrochen werden
Change-Id: Ica5a0483fb2d81cb2583b255126405755d64ba7f
diff --git a/std/thing/commands.c b/std/thing/commands.c
index 404fc9a..8134f4b 100644
--- a/std/thing/commands.c
+++ b/std/thing/commands.c
@@ -339,7 +339,8 @@
// Regeln fuer ein (nun unwichtiges) Verb triggern
static int _process_command(string str, string *noparsestr,
- mixed fun, mixed flag, mixed rule) {
+ mixed fun, mixed flag, mixed rule, mixed id)
+{
mixed *parsed, *objmatches;
// eine Regel ... auswerten ...
@@ -524,12 +525,15 @@
// dann matche ungeparsten Input gegen etwaige Regeln
// -- nicht aendern: neue Kommandos sollen alte "ueberschreiben" koennen
while(nindex--)
- if(_process_command(&str, noparsestr,
- fun[nindex], flag[nindex], rule[nindex]))
+ {
+ mixed cmd_id = (pointerp(ids) && sizeof(ids)>nindex) ? ids[nindex] : 0;
+ if(_process_command(&str, noparsestr, fun[nindex], flag[nindex],
+ rule[nindex], cmd_id))
{
GiveEP(EP_CMD, query_verb());
return 1;
}
+ }
}
// keine Regel passte, unscharfe Auswertung auf alle
diff --git a/sys/thing/commands.h b/sys/thing/commands.h
index 2f9dfc7..8f48587 100644
--- a/sys/thing/commands.h
+++ b/sys/thing/commands.h
@@ -33,8 +33,8 @@
// internal
static int _execute(mixed fun, string str, mixed *parsed);
-static int _process_command(string str, string *noparsestr,mixed fun, mixed flag, mixed rule);
-
+static int _process_command(string str, string *noparsestr,mixed fun,
+ mixed flag, mixed rule, mixed id);
public int _cl(string str);
#endif // __THING_COMMANDS_H_PROTO__