diff options
author | j-p-e-g <j-p-e-g@c06c8d41-db1a-0410-9941-cceddc491573> | 2009-06-20 15:48:37 +0000 |
---|---|---|
committer | j-p-e-g <j-p-e-g@c06c8d41-db1a-0410-9941-cceddc491573> | 2009-06-20 15:48:37 +0000 |
commit | 2971eb60b2a6b98ecc4c9ab3d3958ec732fc6f01 (patch) | |
tree | 89e1a0982f07e29c91636643e4bc0216de2e4a00 /crawl-ref/source/tilepick.cc | |
parent | f41625092d1a3443f64ce9d7bdf99516ad2923b8 (diff) | |
download | crawl-ref-2971eb60b2a6b98ecc4c9ab3d3958ec732fc6f01.tar.gz crawl-ref-2971eb60b2a6b98ecc4c9ab3d3958ec732fc6f01.zip |
Another (final?) update of the doll selection prompt. Things now work exactly
like I envisioned them, and I think we can take the current state and use it
for 0.5.1.
git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@10006 c06c8d41-db1a-0410-9941-cceddc491573
Diffstat (limited to 'crawl-ref/source/tilepick.cc')
-rw-r--r-- | crawl-ref/source/tilepick.cc | 24 |
1 files changed, 14 insertions, 10 deletions
diff --git a/crawl-ref/source/tilepick.cc b/crawl-ref/source/tilepick.cc index b635a9d454..7f32914e84 100644 --- a/crawl-ref/source/tilepick.cc +++ b/crawl-ref/source/tilepick.cc @@ -3215,7 +3215,7 @@ void tilep_part_to_str(int number, char *buf) //normal 2 digits buf[0] = '0' + (number/100) % 10; buf[1] = '0' + (number/ 10) % 10; - buf[2] = '0' + number % 10; + buf[2] = '0' + number % 10; } buf[3] ='\0'; } @@ -3229,7 +3229,7 @@ int tilep_str_to_part(char *str) if (str[0] == '*') return TILEP_SHOW_EQUIP; - //normal 2 digits + //normal 3 digits return atoi(str); } @@ -3297,21 +3297,25 @@ void tilep_scan_parts(char *fbuf, int *parts) */ void tilep_print_parts(char *fbuf, int *parts) { - int i; char *ptr = fbuf; - for (i = 0; parts_saved[i] != -1; ++i) + for (unsigned i = 0; parts_saved[i] != -1; ++i) { int p = parts_saved[i]; - if (p == TILEP_PART_BASE) // 0:female 1:male - { + if (p == TILEP_PART_BASE) // 0: female 1:male sprintf(ptr, "%03d", parts[p] % 2); - ptr += 3; - } else { - tilep_part_to_str(parts[p], ptr); - ptr += 3; + int idx = parts[p]; + if (idx != 0 && idx != TILEP_SHOW_EQUIP) + { + idx = parts[p] - tile_player_part_start[p] + 1; + if (idx < 0 || idx > tile_player_part_count[p]) + idx = 0; + } + tilep_part_to_str(idx, ptr); } + ptr += 3; + *ptr = ':'; ptr++; } |