diff options
author | Bardur Arantsson <bardur@scientician.net> | 2016-09-17 09:58:15 +0200 |
---|---|---|
committer | Bardur Arantsson <bardur@scientician.net> | 2016-09-17 09:58:15 +0200 |
commit | be49084ba59b89c14f8b9f9e1274b013428d7205 (patch) | |
tree | 15820bd89ff65d84926f9101a6e1ef5ed1230d9e | |
parent | 68c4fe1d6494fb6c92d117db170ea39831c16b00 (diff) |
Clean up process_dungeon_file_aux() a little bit
-rw-r--r-- | src/init1.cc | 23 |
1 files changed, 13 insertions, 10 deletions
diff --git a/src/init1.cc b/src/init1.cc index 9fac93c9..c0835da0 100644 --- a/src/init1.cc +++ b/src/init1.cc @@ -6837,29 +6837,32 @@ static errr process_dungeon_file_aux(char *buf, int *yval, int *xval, int xvalst /* Layout of the wilderness */ if (buf[2] == 'D') { - int x; - char i; - /* Acquire the text */ char *s = buf + 4; int y = *yval; - for (x = 0; x < max_wild_x; x++) + for (int x = 0; x < max_wild_x; x++) { - if (1 != sscanf(s + x, "%c", &i)) return (1); - wild_map[y][x].feat = wildc2i[(int)i]; + char i; + if (1 != sscanf(s + x, "%c", &i)) + { + return (1); + } + + auto const wi = wildc2i[(int)i]; + + wild_map[y][x].feat = wi; /* * If this is a town/dungeon entrance, note * its coordinates. (Have to check for * duplicate Morias...) */ - if (wf_info[wildc2i[(int)i]].entrance && - wf_info[wildc2i[(int)i]].wild_x == 0) + if (wf_info[wi].entrance && wf_info[wi].wild_x == 0) { - wf_info[wildc2i[(int)i]].wild_x = x; - wf_info[wildc2i[(int)i]].wild_y = y; + wf_info[wi].wild_x = x; + wf_info[wi].wild_y = y; } } |