(svn r3187) Simplify overly complicated ifs, especially if (foo) return false; else return true; is confusing

This commit is contained in:
tron
2005-11-15 09:47:25 +00:00
parent 9f8c5d8fd2
commit 24f857ed5e
5 changed files with 17 additions and 55 deletions

View File

@@ -2572,24 +2572,14 @@ static void DecodeSpecialSprite(const char* filename, uint num, uint stage)
if (action >= lengthof(handlers)) {
DEBUG(grf, 7) ("Skipping unknown action 0x%02X", action);
free(buf);
return;
}
if (!HASBIT(action_mask, action)) {
} else if (!HASBIT(action_mask, action)) {
DEBUG(grf, 7) ("Skipping action 0x%02X in stage %d", action, stage);
free(buf);
return;
}
if (handlers[action] == NULL) {
} else if (handlers[action] == NULL) {
DEBUG(grf, 7) ("Skipping unsupported Action 0x%02X", action);
free(buf);
return;
} else {
DEBUG(grf, 7) ("Handling action 0x%02X in stage %d", action, stage);
handlers[action](buf, num);
}
DEBUG(grf, 7) ("Handling action 0x%02X in stage %d", action, stage);
handlers[action](buf, num);
free(buf);
}