mirror of
https://github.com/tbamud/tbamud.git
synced 2025-09-21 21:40:49 +02:00
Merge branch 'master' of git@github.com:tbamud/tbamud.git
This commit is contained in:
commit
e59420363a
2 changed files with 5 additions and 4 deletions
|
@ -2486,7 +2486,6 @@ int script_driver(void *go_adress, trig_data *trig, int type, int mode)
|
||||||
char cmd[MAX_INPUT_LENGTH], *p;
|
char cmd[MAX_INPUT_LENGTH], *p;
|
||||||
struct script_data *sc = 0;
|
struct script_data *sc = 0;
|
||||||
struct cmdlist_element *temp;
|
struct cmdlist_element *temp;
|
||||||
unsigned long loops = 0;
|
|
||||||
void *go = NULL;
|
void *go = NULL;
|
||||||
|
|
||||||
void obj_command_interpreter(obj_data *obj, char *argument);
|
void obj_command_interpreter(obj_data *obj, char *argument);
|
||||||
|
@ -2578,8 +2577,8 @@ int script_driver(void *go_adress, trig_data *trig, int type, int mode)
|
||||||
if (process_if(p + 6, go, sc, trig, type)) {
|
if (process_if(p + 6, go, sc, trig, type)) {
|
||||||
temp->original = cl;
|
temp->original = cl;
|
||||||
} else {
|
} else {
|
||||||
|
cl->loops = 0;
|
||||||
cl = temp;
|
cl = temp;
|
||||||
loops = 0;
|
|
||||||
}
|
}
|
||||||
} else if (!strn_cmp("switch ", p, 7)) {
|
} else if (!strn_cmp("switch ", p, 7)) {
|
||||||
cl = find_case(trig, cl, go, sc, type, p + 7);
|
cl = find_case(trig, cl, go, sc, type, p + 7);
|
||||||
|
@ -2599,9 +2598,10 @@ int script_driver(void *go_adress, trig_data *trig, int type, int mode)
|
||||||
if (cl->original && process_if(orig_cmd + 6, go, sc, trig,
|
if (cl->original && process_if(orig_cmd + 6, go, sc, trig,
|
||||||
type)) {
|
type)) {
|
||||||
cl = cl->original;
|
cl = cl->original;
|
||||||
loops++;
|
cl->loops++;
|
||||||
GET_TRIG_LOOPS(trig)++;
|
GET_TRIG_LOOPS(trig)++;
|
||||||
if (loops == 30) {
|
if (cl->loops == 30) {
|
||||||
|
cl->loops = 0;
|
||||||
process_wait(go, trig, type, "wait 1", cl);
|
process_wait(go, trig, type, "wait 1", cl);
|
||||||
depth--;
|
depth--;
|
||||||
return ret_val;
|
return ret_val;
|
||||||
|
|
|
@ -135,6 +135,7 @@ struct cmdlist_element {
|
||||||
char *cmd; /* one line of a trigger */
|
char *cmd; /* one line of a trigger */
|
||||||
struct cmdlist_element *original;
|
struct cmdlist_element *original;
|
||||||
struct cmdlist_element *next;
|
struct cmdlist_element *next;
|
||||||
|
int loops; /* for counting number of runs in a while loop */
|
||||||
};
|
};
|
||||||
|
|
||||||
struct trig_var_data {
|
struct trig_var_data {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue