mirror of
https://github.com/OpenTTD/OpenTTD.git
synced 2025-08-21 13:39:09 +00:00
(svn r4513) Codechange : Assemble a bit the scattered parts of Cargo types.
This commit is contained in:
16
misc.c
16
misc.c
@@ -19,6 +19,7 @@
|
||||
#include "vehicle_gui.h"
|
||||
#include "variables.h"
|
||||
#include "ai/ai.h"
|
||||
#include "table/landscape_const.h"
|
||||
|
||||
extern void StartupEconomy(void);
|
||||
|
||||
@@ -392,30 +393,19 @@ uint ConvertIntDate(uint date)
|
||||
return ConvertYMDToDay(year, month, day);
|
||||
}
|
||||
|
||||
typedef struct LandscapePredefVar {
|
||||
StringID names[NUM_CARGO];
|
||||
byte weights[NUM_CARGO];
|
||||
StringID sprites[NUM_CARGO];
|
||||
|
||||
uint16 initial_cargo_payment[NUM_CARGO];
|
||||
byte transit_days_table_1[NUM_CARGO];
|
||||
byte transit_days_table_2[NUM_CARGO];
|
||||
|
||||
byte road_veh_by_cargo_start[NUM_CARGO];
|
||||
byte road_veh_by_cargo_count[NUM_CARGO];
|
||||
} LandscapePredefVar;
|
||||
|
||||
#include "table/landscape_const.h"
|
||||
|
||||
|
||||
// Calculate constants that depend on the landscape type.
|
||||
void InitializeLandscapeVariables(bool only_constants)
|
||||
{
|
||||
const LandscapePredefVar *lpd;
|
||||
const CargoTypesValues *lpd;
|
||||
uint i;
|
||||
StringID str;
|
||||
|
||||
lpd = &_landscape_predef_var[_opt.landscape];
|
||||
lpd = &_cargo_types_base_values[_opt.landscape];
|
||||
|
||||
memcpy(_cargoc.ai_roadveh_start, lpd->road_veh_by_cargo_start,sizeof(lpd->road_veh_by_cargo_start));
|
||||
memcpy(_cargoc.ai_roadveh_count, lpd->road_veh_by_cargo_count,sizeof(lpd->road_veh_by_cargo_count));
|
||||
|
Reference in New Issue
Block a user