CID 26253: Control flow issues (DEADCODE)

transformations gone wrong in previous commit
This commit is contained in:
Enno Rehling 2015-10-29 16:50:55 +01:00
parent 6113bc2144
commit 1a252bc994
1 changed files with 5 additions and 4 deletions

View File

@ -284,8 +284,8 @@ int teach_cmd(unit * u, struct order *ord)
static const curse_type *gbdream_ct = NULL; static const curse_type *gbdream_ct = NULL;
plane *pl; plane *pl;
region *r = u->region; region *r = u->region;
int teaching, i, j, count, academy = 0;
skill_t sk = NOSKILL; skill_t sk = NOSKILL;
int teaching, i, j, count, academy = 0;
if (gbdream_ct == 0) if (gbdream_ct == 0)
gbdream_ct = ct_find("gbdream"); gbdream_ct = ct_find("gbdream");
@ -328,11 +328,12 @@ int teach_cmd(unit * u, struct order *ord)
if (getparam(u->faction->locale) == P_ANY) { if (getparam(u->faction->locale) == P_ANY) {
unit *student; unit *student;
skill_t teachskill[MAXSKILLS]; skill_t teachskill[MAXSKILLS];
int t; int t = 0;
for (t = 0; sk != NOSKILL; ++t) { do {
sk = getskill(u->faction->locale);
teachskill[t] = getskill(u->faction->locale); teachskill[t] = getskill(u->faction->locale);
}; } while (sk != NOSKILL);
for (student = r->units; teaching && student; student = student->next) { for (student = r->units; teaching && student; student = student->next) {
if (LongHunger(student)) { if (LongHunger(student)) {