(svn r8621) -Codechange: assigned new numbers to the VEH_(type) enum so that VEH_Train is 0, VEH_Road is 1 and so on

This means that "v->type" can be used as array indexes instead of VehTypeToIndex() (or "v->type - VEH_Train/0x10 as the code still used in some places)
  Surprisingly this can be done without changing the savegame format
This commit is contained in:
bjarni
2007-02-07 19:10:19 +00:00
parent 022e11d421
commit d40886903d
13 changed files with 45 additions and 55 deletions

View File

@@ -1132,7 +1132,7 @@ void PlayerVehWndProc(Window *w, WindowEvent *e)
};
/* XXX - Substite string since the dropdown cannot handle dynamic strings */
action_str[2] = depot_name[vl->vehicle_type - VEH_Train];
action_str[2] = depot_name[vl->vehicle_type];
ShowDropDownMenu(w, action_str, 0, VLW_WIDGET_MANAGE_VEHICLES_DROPDOWN, 0, 0);
break;
}