github pull request #628 - duplicate code

Pull request from argrath nearly a year ago: an 'if' and corresponding
'else' have the same code so there's no point in testing for if/else.

I'm still not convinced that simply removing the if/else is the right
fix here but nothing else is going on.  I've put part of the removed
code back inside '#if 0' in case it needs to be resurrected someday.

Closes #628
This commit is contained in:
PatR
2022-09-21 17:02:45 -07:00
parent 2a8ddf1145
commit ecf55926be

View File

@@ -1387,7 +1387,15 @@ root_plselection_prompt(
if (alignnum != ROLE_NONE && alignnum != ROLE_RANDOM
&& ok_align(rolenum, racenum, gendnum, alignnum)) {
#if 0 /* 'if' and 'else' had duplicate code here; probably a copy+parse
* oversight; if a problem with filtering of random role selection
* crops up, this is probably the place to start looking */
/* if race specified, and multiple choice of alignments for it */
if ((racenum >= 0) && (aligncount > 1)) {
} else {
}
#endif /* the four lines of code below were in both 'if' and 'else' above */
if (donefirst)
Strcat(buf, " ");
Strcat(buf, aligns[alignnum].adj);