diff options
author | zelgadis <zelgadis@c06c8d41-db1a-0410-9941-cceddc491573> | 2008-05-27 01:48:13 +0000 |
---|---|---|
committer | zelgadis <zelgadis@c06c8d41-db1a-0410-9941-cceddc491573> | 2008-05-27 01:48:13 +0000 |
commit | 2aa69c8f83e2afd25a355bc1c70acb646f425b9f (patch) | |
tree | 5ecb316636fce46b3f62d9c4eb8bd1c983a58871 /crawl-ref/source/message.cc | |
parent | 298d76bd71d68a4e8d3b9ceafbdad1aece9a8f44 (diff) | |
download | crawl-ref-2aa69c8f83e2afd25a355bc1c70acb646f425b9f.tar.gz crawl-ref-2aa69c8f83e2afd25a355bc1c70acb646f425b9f.zip |
Added "error" channel for runtime errors, and changed error messages that
used the "danger" or "warning" channels to use that. Sending an error
message to the error channel has the side effect of interrupting all
activity.
git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@5276 c06c8d41-db1a-0410-9941-cceddc491573
Diffstat (limited to 'crawl-ref/source/message.cc')
-rw-r--r-- | crawl-ref/source/message.cc | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/crawl-ref/source/message.cc b/crawl-ref/source/message.cc index 90dcb3ea95..cfaf13ec16 100644 --- a/crawl-ref/source/message.cc +++ b/crawl-ref/source/message.cc @@ -132,7 +132,7 @@ namespace msg if ( internal_count + 3 > INTERNAL_LENGTH ) { - mpr("oops, hit overflow", MSGCH_DANGER); + mpr("oops, hit overflow", MSGCH_ERROR); internal_count = 0; return std::streambuf::traits_type::eof(); } @@ -262,6 +262,7 @@ int channel_to_colour( msg_channel_type channel, int param ) break; case MSGCH_WARN: + case MSGCH_ERROR: ret = LIGHTRED; break; @@ -371,6 +372,9 @@ static void do_message_print( msg_channel_type channel, int param, buff[199] = 0; mpr(buff, channel, param); + + if (channel == MSGCH_ERROR) + interrupt_activity( AI_FORCE_INTERRUPT ); } void mprf( msg_channel_type channel, int param, const char *format, ... ) @@ -402,7 +406,7 @@ void mpr(const char *inf, msg_channel_type channel, int param) { if (!crawl_state.io_inited) { - if (channel == MSGCH_WARN) + if (channel == MSGCH_ERROR) fprintf(stderr, "%s\n", inf); return; } |