projects
/
open-adventure.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Change YES() to take const char* arguments.
[open-adventure.git]
/
dungeon.c
diff --git
a/dungeon.c
b/dungeon.c
index ffa5140b6fdf4c482e161a89a809c2c533f6b922..0d82fb6715fbd7566d5ff601de16fd6f10e96898 100644
(file)
--- a/
dungeon.c
+++ b/
dungeon.c
@@
-230,7
+230,7
@@
static void read_messages(FILE* database, long sect)
if (sect == 10) {
CLSSES = CLSSES + 1;
if (CLSSES > CLSMAX)
if (sect == 10) {
CLSSES = CLSSES + 1;
if (CLSSES > CLSMAX)
- BUG(TOO_MANY_CLASS_OR_TURN_MESSAGES);
+
BUG(TOO_MANY_CLASS_OR_TURN_MESSAGES);
CTEXT[CLSSES] = LINUSE;
CVAL[CLSSES] = loc;
continue;
CTEXT[CLSSES] = LINUSE;
CVAL[CLSSES] = loc;
continue;
@@
-324,7
+324,7
@@
static void read_conditions(FILE* database)
long loc;
while ((loc = GETNUM(NULL)) != 0) {
if (is_set(COND[loc], K))
long loc;
while ((loc = GETNUM(NULL)) != 0) {
if (is_set(COND[loc], K))
- BUG(LOCATION_HAS_CONDITION_BIT_BEING_SET_TWICE);
+
BUG(LOCATION_HAS_CONDITION_BIT_BEING_SET_TWICE);
COND[loc] = COND[loc] + (1l << K);
}
}
COND[loc] = COND[loc] + (1l << K);
}
}
@@
-338,7
+338,7
@@
static void read_hints(FILE* database)
HNTMAX = 0;
while ((K = GETNUM(database)) != -1) {
if (K <= 0 || K > HNTSIZ)
HNTMAX = 0;
while ((K = GETNUM(database)) != -1) {
if (K <= 0 || K > HNTSIZ)
- BUG(TOO_MANY_HINTS);
+
BUG(TOO_MANY_HINTS);
for (int I = 1; I <= 4; I++) {
HINTS[K][I] = GETNUM(NULL);
} /* end loop */
for (int I = 1; I <= 4; I++) {
HINTS[K][I] = GETNUM(NULL);
} /* end loop */
@@
-554,6
+554,12
@@
static void write_file(FILE* header_file)
fprintf(header_file, "#endif\n");
}
fprintf(header_file, "#endif\n");
}
+void bug(enum bugtype num, const char *error_string)
+{
+ fprintf(stderr, "Fatal error %d, %s.\n", num, error_string);
+ exit(EXIT_FAILURE);
+}
+
int main(void)
{
FILE* database = fopen("adventure.text", "r");
int main(void)
{
FILE* database = fopen("adventure.text", "r");