mirror of
https://github.com/tbamud/tbamud.git
synced 2026-04-30 04:41:51 +02:00
Compare commits
4 Commits
2e0668d4f8
...
copilot/fi
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
ed5f6a81da | ||
|
|
a2e3c2481d | ||
|
|
87c75da59c | ||
|
|
ac94839eb5 |
2
.github/workflows/build.yml
vendored
2
.github/workflows/build.yml
vendored
@@ -3,7 +3,7 @@ name: C/C++ CI
|
|||||||
on:
|
on:
|
||||||
push:
|
push:
|
||||||
branches: [ "master" ]
|
branches: [ "master" ]
|
||||||
pull_request:
|
pull_request_target:
|
||||||
branches: [ "master" ]
|
branches: [ "master" ]
|
||||||
|
|
||||||
permissions:
|
permissions:
|
||||||
|
|||||||
@@ -1024,17 +1024,27 @@ ACMD(do_mdoor)
|
|||||||
}
|
}
|
||||||
|
|
||||||
if ((rm = get_room(target)) == NULL) {
|
if ((rm = get_room(target)) == NULL) {
|
||||||
mob_log(ch, "mdoor: invalid target");
|
mob_log(ch, "mdoor: invalid target (arg == %s)", target);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ((dir = search_block(direction, dirs, FALSE)) == -1) {
|
if ((dir = search_block(direction, dirs, FALSE)) == -1) {
|
||||||
mob_log(ch, "mdoor: invalid direction");
|
char dirs_str[256];
|
||||||
|
int di, doff = 0;
|
||||||
|
dirs_str[0] = '\0';
|
||||||
|
for (di = 0; *dirs[di] != '\n'; di++)
|
||||||
|
doff += snprintf(dirs_str + doff, sizeof(dirs_str) - doff, "%s%s", doff ? " " : "", dirs[di]);
|
||||||
|
mob_log(ch, "mdoor: invalid direction (arg == %s) not found in: [ %s ]", direction, dirs_str);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ((fd = search_block(field, door_field, FALSE)) == -1) {
|
if ((fd = search_block(field, door_field, FALSE)) == -1) {
|
||||||
mob_log(ch, "odoor: invalid field");
|
char fields_str[256];
|
||||||
|
int fi, foff = 0;
|
||||||
|
fields_str[0] = '\0';
|
||||||
|
for (fi = 0; *door_field[fi] != '\n'; fi++)
|
||||||
|
foff += snprintf(fields_str + foff, sizeof(fields_str) - foff, "%s%s", foff ? " " : "", door_field[fi]);
|
||||||
|
mob_log(ch, "mdoor: invalid field (arg == %s) not found in: [ %s ]", field, fields_str);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1081,8 +1091,10 @@ ACMD(do_mdoor)
|
|||||||
case 5: /* room */
|
case 5: /* room */
|
||||||
if ((to_room = real_room(atoi(value))) != NOWHERE)
|
if ((to_room = real_room(atoi(value))) != NOWHERE)
|
||||||
newexit->to_room = to_room;
|
newexit->to_room = to_room;
|
||||||
else
|
else {
|
||||||
mob_log(ch, "mdoor: invalid door target");
|
newexit->to_room = NOWHERE;
|
||||||
|
mob_log(ch, "mdoor: invalid door target (arg == %s)", value);
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -625,17 +625,27 @@ static OCMD(do_odoor)
|
|||||||
}
|
}
|
||||||
|
|
||||||
if ((rm = get_room(target)) == NULL) {
|
if ((rm = get_room(target)) == NULL) {
|
||||||
obj_log(obj, "odoor: invalid target");
|
obj_log(obj, "odoor: invalid target (arg == %s)", target);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ((dir = search_block(direction, dirs, FALSE)) == -1) {
|
if ((dir = search_block(direction, dirs, FALSE)) == -1) {
|
||||||
obj_log(obj, "odoor: invalid direction");
|
char dirs_str[256];
|
||||||
|
int di, doff = 0;
|
||||||
|
dirs_str[0] = '\0';
|
||||||
|
for (di = 0; *dirs[di] != '\n'; di++)
|
||||||
|
doff += snprintf(dirs_str + doff, sizeof(dirs_str) - doff, "%s%s", doff ? " " : "", dirs[di]);
|
||||||
|
obj_log(obj, "odoor: invalid direction (arg == %s) not found in: [ %s ]", direction, dirs_str);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ((fd = search_block(field, door_field, FALSE)) == -1) {
|
if ((fd = search_block(field, door_field, FALSE)) == -1) {
|
||||||
obj_log(obj, "odoor: invalid field");
|
char fields_str[256];
|
||||||
|
int fi, foff = 0;
|
||||||
|
fields_str[0] = '\0';
|
||||||
|
for (fi = 0; *door_field[fi] != '\n'; fi++)
|
||||||
|
foff += snprintf(fields_str + foff, sizeof(fields_str) - foff, "%s%s", foff ? " " : "", door_field[fi]);
|
||||||
|
obj_log(obj, "odoor: invalid field (arg == %s) not found in: [ %s ]", field, fields_str);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -682,8 +692,10 @@ static OCMD(do_odoor)
|
|||||||
case 5: /* room */
|
case 5: /* room */
|
||||||
if ((to_room = real_room(atoi(value))) != NOWHERE)
|
if ((to_room = real_room(atoi(value))) != NOWHERE)
|
||||||
newexit->to_room = to_room;
|
newexit->to_room = to_room;
|
||||||
else
|
else {
|
||||||
obj_log(obj, "odoor: invalid door target");
|
newexit->to_room = NOWHERE;
|
||||||
|
obj_log(obj, "odoor: invalid door target (arg == %s)", value);
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1636,6 +1636,13 @@ void var_subst(void *go, struct script_data *sc, trig_data *trig,
|
|||||||
int paren_count = 0;
|
int paren_count = 0;
|
||||||
int dots = 0;
|
int dots = 0;
|
||||||
|
|
||||||
|
/* reject lines that would overflow our fixed-size buffers */
|
||||||
|
if (strnlen(line, MAX_INPUT_LENGTH) >= MAX_INPUT_LENGTH) {
|
||||||
|
script_log("Trigger VNum %d: variable substitution line too long, ignoring.", GET_TRIG_VNUM(trig));
|
||||||
|
*buf = '\0';
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
/* skip out if no %'s */
|
/* skip out if no %'s */
|
||||||
if (!strchr(line, '%')) {
|
if (!strchr(line, '%')) {
|
||||||
strcpy(buf, line);
|
strcpy(buf, line);
|
||||||
|
|||||||
@@ -224,17 +224,27 @@ WCMD(do_wdoor)
|
|||||||
}
|
}
|
||||||
|
|
||||||
if ((rm = get_room(target)) == NULL) {
|
if ((rm = get_room(target)) == NULL) {
|
||||||
wld_log(room, "wdoor: invalid target");
|
wld_log(room, "wdoor: invalid target (arg == %s)", target);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ((dir = search_block(direction, dirs, FALSE)) == -1) {
|
if ((dir = search_block(direction, dirs, FALSE)) == -1) {
|
||||||
wld_log(room, "wdoor: invalid direction");
|
char dirs_str[256];
|
||||||
|
int di, doff = 0;
|
||||||
|
dirs_str[0] = '\0';
|
||||||
|
for (di = 0; *dirs[di] != '\n'; di++)
|
||||||
|
doff += snprintf(dirs_str + doff, sizeof(dirs_str) - doff, "%s%s", doff ? " " : "", dirs[di]);
|
||||||
|
wld_log(room, "wdoor: invalid direction (arg == %s) not found in: [ %s ]", direction, dirs_str);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ((fd = search_block(field, door_field, FALSE)) == -1) {
|
if ((fd = search_block(field, door_field, FALSE)) == -1) {
|
||||||
wld_log(room, "wdoor: invalid field");
|
char fields_str[256];
|
||||||
|
int fi, foff = 0;
|
||||||
|
fields_str[0] = '\0';
|
||||||
|
for (fi = 0; *door_field[fi] != '\n'; fi++)
|
||||||
|
foff += snprintf(fields_str + foff, sizeof(fields_str) - foff, "%s%s", foff ? " " : "", door_field[fi]);
|
||||||
|
wld_log(room, "wdoor: invalid field (arg == %s) not found in: [ %s ]", field, fields_str);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -281,8 +291,10 @@ WCMD(do_wdoor)
|
|||||||
case 5: /* room */
|
case 5: /* room */
|
||||||
if ((to_room = real_room(atoi(value))) != NOWHERE)
|
if ((to_room = real_room(atoi(value))) != NOWHERE)
|
||||||
newexit->to_room = to_room;
|
newexit->to_room = to_room;
|
||||||
else
|
else {
|
||||||
wld_log(room, "wdoor: invalid door target");
|
newexit->to_room = NOWHERE;
|
||||||
|
wld_log(room, "wdoor: invalid door target (arg == %s)", value);
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user