From 38e827333b1b54e7388162ba5f9db5ef308fb96c Mon Sep 17 00:00:00 2001 From: ennewalker Date: Mon, 24 Mar 2008 04:23:58 +0000 Subject: Monster list fixes: * get_visible_monsters() now just silently returns descriptions * _mpr_monsters() now handles all printing of information * monster list is now written to a separate monster region (GOTO_MLIST) * added asserts to libutil that will catch behavior that breaks tile version * turned off monster list for tile version (until implemented) git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@3851 c06c8d41-db1a-0410-9941-cceddc491573 --- crawl-ref/source/libutil.cc | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'crawl-ref/source/libutil.cc') diff --git a/crawl-ref/source/libutil.cc b/crawl-ref/source/libutil.cc index 542bbbc162..1599ff1411 100644 --- a/crawl-ref/source/libutil.cc +++ b/crawl-ref/source/libutil.cc @@ -576,12 +576,23 @@ int snprintf( char *str, size_t size, const char *format, ... ) #ifndef USE_TILE void cgotoxy(int x, int y, int region) { + ASSERT(x >= 1); + ASSERT(y >= 1); switch(region) { + case GOTO_MLIST: + ASSERT(x <= crawl_view.mlistsz.x); + ASSERT(y <= crawl_view.mlistsz.y); + gotoxy_sys(x + crawl_view.mlistp.x - 1, y + crawl_view.mlistp.y - 1); + break; case GOTO_STAT: + ASSERT(x <= crawl_view.hudsz.x); + ASSERT(y <= crawl_view.hudsz.y); gotoxy_sys(x + crawl_view.hudp.x - 1, y + crawl_view.hudp.y - 1); break; case GOTO_MSG: + ASSERT(x <= crawl_view.msgsz.x); + ASSERT(y <= crawl_view.msgsz.y); gotoxy_sys(x + crawl_view.msgp.x - 1, y + crawl_view.msgp.y - 1); break; case GOTO_CRT: -- cgit v1.2.3-54-g00ecf