1
0
Fork 0

(svn r9638) -Feature: Increase cargo types from 12 to 32 and enable newcargo flag in NewGRF loader.

release/0.6
peter1138 2007-04-15 16:20:35 +00:00
parent 24e95eb2cd
commit 49eb9b6fad
6 changed files with 10 additions and 7 deletions

View File

@ -1826,8 +1826,9 @@ static void SaveLoad_PRIC()
/** Cargo payment rates */ /** Cargo payment rates */
static void SaveLoad_CAPR() static void SaveLoad_CAPR()
{ {
SlArray(&_cargo_payment_rates, NUM_CARGO, SLE_INT32); uint num_cargo = CheckSavegameVersion(55) ? 12 : NUM_CARGO;
SlArray(&_cargo_payment_rates_frac, NUM_CARGO, SLE_UINT16); SlArray(&_cargo_payment_rates, num_cargo, SLE_INT32);
SlArray(&_cargo_payment_rates_frac, num_cargo, SLE_UINT16);
} }
static const SaveLoad _economy_desc[] = { static const SaveLoad _economy_desc[] = {

View File

@ -26,7 +26,7 @@ static uint _legend_excluded_cargo;
/************************/ /************************/
enum { enum {
GRAPH_MAX_DATASETS = 16, GRAPH_MAX_DATASETS = 32,
GRAPH_AXIS_LABEL_COLOUR = 16, GRAPH_AXIS_LABEL_COLOUR = 16,
GRAPH_AXIS_LINE_COLOUR = 215, GRAPH_AXIS_LINE_COLOUR = 215,

View File

@ -4108,7 +4108,7 @@ static void InitializeGRFSpecial()
| (0 << 0x08) // fifoloading | (0 << 0x08) // fifoloading
| (0 << 0x09) // townroadbranchprob | (0 << 0x09) // townroadbranchprob
| (0 << 0x0A) // tempsnowline | (0 << 0x0A) // tempsnowline
| (0 << 0x0B) // newcargo | (1 << 0x0B) // newcargo
| (1 << 0x0C) // enhancemultiplayer | (1 << 0x0C) // enhancemultiplayer
| (1 << 0x0D) // onewayroads | (1 << 0x0D) // onewayroads
| ((_patches.nonuniform_stations ? 1 : 0) << 0x0E) // irregularstations | ((_patches.nonuniform_stations ? 1 : 0) << 0x0E) // irregularstations

View File

@ -317,7 +317,7 @@ enum {
CT_PLASTIC = 10, CT_PLASTIC = 10,
CT_FIZZY_DRINKS = 11, CT_FIZZY_DRINKS = 11,
NUM_CARGO = 12, NUM_CARGO = 32,
CT_NO_REFIT = 0xFE, CT_NO_REFIT = 0xFE,
CT_INVALID = 0xFF CT_INVALID = 0xFF

View File

@ -28,7 +28,7 @@
#include "variables.h" #include "variables.h"
#include <setjmp.h> #include <setjmp.h>
extern const uint16 SAVEGAME_VERSION = 54; extern const uint16 SAVEGAME_VERSION = 55;
uint16 _sl_version; ///< the major savegame version identifier uint16 _sl_version; ///< the major savegame version identifier
byte _sl_minor_version; ///< the minor savegame version, DO NOT USE! byte _sl_minor_version; ///< the minor savegame version, DO NOT USE!

View File

@ -2820,7 +2820,9 @@ static const SaveLoad _station_speclist_desc[] = {
static void SaveLoad_STNS(Station *st) static void SaveLoad_STNS(Station *st)
{ {
SlObject(st, _station_desc); SlObject(st, _station_desc);
for (CargoID i = 0; i < NUM_CARGO; i++) {
uint num_cargo = CheckSavegameVersion(55) ? 12 : NUM_CARGO;
for (CargoID i = 0; i < num_cargo; i++) {
SlObject(&st->goods[i], _goods_desc); SlObject(&st->goods[i], _goods_desc);
} }