Codechange: Replace FOR_ALL_TOWNS with range-based for loops

This commit is contained in:
glx
2019-12-17 22:04:09 +01:00
committed by Niels Martin Hansen
parent 0b489f9924
commit ee7a8eebca
17 changed files with 39 additions and 88 deletions

View File

@@ -347,9 +347,7 @@ struct NetworkChatWindow : public Window {
* Not that the following assumes all town indices are adjacent, ie no
* towns have been deleted. */
if (*item < (uint)MAX_CLIENT_SLOTS + Town::GetPoolSize()) {
const Town *t;
FOR_ALL_TOWNS_FROM(t, *item - MAX_CLIENT_SLOTS) {
for (const Town *t : Town::Iterate(*item - MAX_CLIENT_SLOTS)) {
/* Get the town-name via the string-system */
SetDParam(0, t->index);
GetString(chat_tab_temp_buffer, STR_TOWN_NAME, lastof(chat_tab_temp_buffer));