src/newgrf_cargo.cpp
author convert-repo
Mon, 07 Apr 2008 16:21:55 +0000
changeset 10076 dfd70e42c4ae
parent 9252 92e05c28a994
child 10429 1b99254f9607
permissions -rw-r--r--
update tags
6691
e8c27a509894 (svn r9418) -Codechange: Implement actions 1/2/3 for cargos, callback handler and custom icon sprites
peter1138
parents:
diff changeset
     1
/* $Id$ */
e8c27a509894 (svn r9418) -Codechange: Implement actions 1/2/3 for cargos, callback handler and custom icon sprites
peter1138
parents:
diff changeset
     2
e8c27a509894 (svn r9418) -Codechange: Implement actions 1/2/3 for cargos, callback handler and custom icon sprites
peter1138
parents:
diff changeset
     3
#include "stdafx.h"
e8c27a509894 (svn r9418) -Codechange: Implement actions 1/2/3 for cargos, callback handler and custom icon sprites
peter1138
parents:
diff changeset
     4
#include "openttd.h"
6709
e440af8c72ca (svn r9473) -Codechange: add 'unhandled variable' debug message to newcargo resolver
peter1138
parents: 6691
diff changeset
     5
#include "debug.h"
6691
e8c27a509894 (svn r9418) -Codechange: Implement actions 1/2/3 for cargos, callback handler and custom icon sprites
peter1138
parents:
diff changeset
     6
#include "cargotype.h"
e8c27a509894 (svn r9418) -Codechange: Implement actions 1/2/3 for cargos, callback handler and custom icon sprites
peter1138
parents:
diff changeset
     7
#include "newgrf.h"
e8c27a509894 (svn r9418) -Codechange: Implement actions 1/2/3 for cargos, callback handler and custom icon sprites
peter1138
parents:
diff changeset
     8
#include "newgrf_callbacks.h"
e8c27a509894 (svn r9418) -Codechange: Implement actions 1/2/3 for cargos, callback handler and custom icon sprites
peter1138
parents:
diff changeset
     9
#include "newgrf_spritegroup.h"
e8c27a509894 (svn r9418) -Codechange: Implement actions 1/2/3 for cargos, callback handler and custom icon sprites
peter1138
parents:
diff changeset
    10
#include "newgrf_cargo.h"
e8c27a509894 (svn r9418) -Codechange: Implement actions 1/2/3 for cargos, callback handler and custom icon sprites
peter1138
parents:
diff changeset
    11
e8c27a509894 (svn r9418) -Codechange: Implement actions 1/2/3 for cargos, callback handler and custom icon sprites
peter1138
parents:
diff changeset
    12
e8c27a509894 (svn r9418) -Codechange: Implement actions 1/2/3 for cargos, callback handler and custom icon sprites
peter1138
parents:
diff changeset
    13
static uint32 CargoGetRandomBits(const ResolverObject *object)
e8c27a509894 (svn r9418) -Codechange: Implement actions 1/2/3 for cargos, callback handler and custom icon sprites
peter1138
parents:
diff changeset
    14
{
e8c27a509894 (svn r9418) -Codechange: Implement actions 1/2/3 for cargos, callback handler and custom icon sprites
peter1138
parents:
diff changeset
    15
	return 0;
e8c27a509894 (svn r9418) -Codechange: Implement actions 1/2/3 for cargos, callback handler and custom icon sprites
peter1138
parents:
diff changeset
    16
}
e8c27a509894 (svn r9418) -Codechange: Implement actions 1/2/3 for cargos, callback handler and custom icon sprites
peter1138
parents:
diff changeset
    17
e8c27a509894 (svn r9418) -Codechange: Implement actions 1/2/3 for cargos, callback handler and custom icon sprites
peter1138
parents:
diff changeset
    18
e8c27a509894 (svn r9418) -Codechange: Implement actions 1/2/3 for cargos, callback handler and custom icon sprites
peter1138
parents:
diff changeset
    19
static uint32 CargoGetTriggers(const ResolverObject *object)
e8c27a509894 (svn r9418) -Codechange: Implement actions 1/2/3 for cargos, callback handler and custom icon sprites
peter1138
parents:
diff changeset
    20
{
e8c27a509894 (svn r9418) -Codechange: Implement actions 1/2/3 for cargos, callback handler and custom icon sprites
peter1138
parents:
diff changeset
    21
	return 0;
e8c27a509894 (svn r9418) -Codechange: Implement actions 1/2/3 for cargos, callback handler and custom icon sprites
peter1138
parents:
diff changeset
    22
}
e8c27a509894 (svn r9418) -Codechange: Implement actions 1/2/3 for cargos, callback handler and custom icon sprites
peter1138
parents:
diff changeset
    23
e8c27a509894 (svn r9418) -Codechange: Implement actions 1/2/3 for cargos, callback handler and custom icon sprites
peter1138
parents:
diff changeset
    24
e8c27a509894 (svn r9418) -Codechange: Implement actions 1/2/3 for cargos, callback handler and custom icon sprites
peter1138
parents:
diff changeset
    25
static void CargoSetTriggers(const ResolverObject *object, int triggers)
e8c27a509894 (svn r9418) -Codechange: Implement actions 1/2/3 for cargos, callback handler and custom icon sprites
peter1138
parents:
diff changeset
    26
{
e8c27a509894 (svn r9418) -Codechange: Implement actions 1/2/3 for cargos, callback handler and custom icon sprites
peter1138
parents:
diff changeset
    27
	return;
e8c27a509894 (svn r9418) -Codechange: Implement actions 1/2/3 for cargos, callback handler and custom icon sprites
peter1138
parents:
diff changeset
    28
}
e8c27a509894 (svn r9418) -Codechange: Implement actions 1/2/3 for cargos, callback handler and custom icon sprites
peter1138
parents:
diff changeset
    29
e8c27a509894 (svn r9418) -Codechange: Implement actions 1/2/3 for cargos, callback handler and custom icon sprites
peter1138
parents:
diff changeset
    30
e8c27a509894 (svn r9418) -Codechange: Implement actions 1/2/3 for cargos, callback handler and custom icon sprites
peter1138
parents:
diff changeset
    31
static uint32 CargoGetVariable(const ResolverObject *object, byte variable, byte parameter, bool *available)
e8c27a509894 (svn r9418) -Codechange: Implement actions 1/2/3 for cargos, callback handler and custom icon sprites
peter1138
parents:
diff changeset
    32
{
6709
e440af8c72ca (svn r9473) -Codechange: add 'unhandled variable' debug message to newcargo resolver
peter1138
parents: 6691
diff changeset
    33
	DEBUG(grf, 1, "Unhandled cargo property 0x%X", variable);
e440af8c72ca (svn r9473) -Codechange: add 'unhandled variable' debug message to newcargo resolver
peter1138
parents: 6691
diff changeset
    34
6691
e8c27a509894 (svn r9418) -Codechange: Implement actions 1/2/3 for cargos, callback handler and custom icon sprites
peter1138
parents:
diff changeset
    35
	*available = false;
e8c27a509894 (svn r9418) -Codechange: Implement actions 1/2/3 for cargos, callback handler and custom icon sprites
peter1138
parents:
diff changeset
    36
	return 0;
e8c27a509894 (svn r9418) -Codechange: Implement actions 1/2/3 for cargos, callback handler and custom icon sprites
peter1138
parents:
diff changeset
    37
}
e8c27a509894 (svn r9418) -Codechange: Implement actions 1/2/3 for cargos, callback handler and custom icon sprites
peter1138
parents:
diff changeset
    38
e8c27a509894 (svn r9418) -Codechange: Implement actions 1/2/3 for cargos, callback handler and custom icon sprites
peter1138
parents:
diff changeset
    39
e8c27a509894 (svn r9418) -Codechange: Implement actions 1/2/3 for cargos, callback handler and custom icon sprites
peter1138
parents:
diff changeset
    40
static const SpriteGroup *CargoResolveReal(const ResolverObject *object, const SpriteGroup *group)
e8c27a509894 (svn r9418) -Codechange: Implement actions 1/2/3 for cargos, callback handler and custom icon sprites
peter1138
parents:
diff changeset
    41
{
7153
85b73fcc076b (svn r9888) -Codechange: [NewGRF] allow non-spec cargo action2s to work, and using the goods sprite if really nothing is returned.
peter1138
parents: 6956
diff changeset
    42
	/* Cargo action 2s should always have only 1 "loaded" state, but some
85b73fcc076b (svn r9888) -Codechange: [NewGRF] allow non-spec cargo action2s to work, and using the goods sprite if really nothing is returned.
peter1138
parents: 6956
diff changeset
    43
	 * times things don't follow the spec... */
85b73fcc076b (svn r9888) -Codechange: [NewGRF] allow non-spec cargo action2s to work, and using the goods sprite if really nothing is returned.
peter1138
parents: 6956
diff changeset
    44
	if (group->g.real.num_loaded > 0) return group->g.real.loaded[0];
85b73fcc076b (svn r9888) -Codechange: [NewGRF] allow non-spec cargo action2s to work, and using the goods sprite if really nothing is returned.
peter1138
parents: 6956
diff changeset
    45
	if (group->g.real.num_loading > 0) return group->g.real.loading[0];
6691
e8c27a509894 (svn r9418) -Codechange: Implement actions 1/2/3 for cargos, callback handler and custom icon sprites
peter1138
parents:
diff changeset
    46
7153
85b73fcc076b (svn r9888) -Codechange: [NewGRF] allow non-spec cargo action2s to work, and using the goods sprite if really nothing is returned.
peter1138
parents: 6956
diff changeset
    47
	return NULL;
6691
e8c27a509894 (svn r9418) -Codechange: Implement actions 1/2/3 for cargos, callback handler and custom icon sprites
peter1138
parents:
diff changeset
    48
}
e8c27a509894 (svn r9418) -Codechange: Implement actions 1/2/3 for cargos, callback handler and custom icon sprites
peter1138
parents:
diff changeset
    49
e8c27a509894 (svn r9418) -Codechange: Implement actions 1/2/3 for cargos, callback handler and custom icon sprites
peter1138
parents:
diff changeset
    50
e8c27a509894 (svn r9418) -Codechange: Implement actions 1/2/3 for cargos, callback handler and custom icon sprites
peter1138
parents:
diff changeset
    51
static void NewCargoResolver(ResolverObject *res, const CargoSpec *cs)
e8c27a509894 (svn r9418) -Codechange: Implement actions 1/2/3 for cargos, callback handler and custom icon sprites
peter1138
parents:
diff changeset
    52
{
e8c27a509894 (svn r9418) -Codechange: Implement actions 1/2/3 for cargos, callback handler and custom icon sprites
peter1138
parents:
diff changeset
    53
	res->GetRandomBits = &CargoGetRandomBits;
e8c27a509894 (svn r9418) -Codechange: Implement actions 1/2/3 for cargos, callback handler and custom icon sprites
peter1138
parents:
diff changeset
    54
	res->GetTriggers   = &CargoGetTriggers;
e8c27a509894 (svn r9418) -Codechange: Implement actions 1/2/3 for cargos, callback handler and custom icon sprites
peter1138
parents:
diff changeset
    55
	res->SetTriggers   = &CargoSetTriggers;
e8c27a509894 (svn r9418) -Codechange: Implement actions 1/2/3 for cargos, callback handler and custom icon sprites
peter1138
parents:
diff changeset
    56
	res->GetVariable   = &CargoGetVariable;
e8c27a509894 (svn r9418) -Codechange: Implement actions 1/2/3 for cargos, callback handler and custom icon sprites
peter1138
parents:
diff changeset
    57
	res->ResolveReal   = &CargoResolveReal;
e8c27a509894 (svn r9418) -Codechange: Implement actions 1/2/3 for cargos, callback handler and custom icon sprites
peter1138
parents:
diff changeset
    58
e8c27a509894 (svn r9418) -Codechange: Implement actions 1/2/3 for cargos, callback handler and custom icon sprites
peter1138
parents:
diff changeset
    59
	res->u.cargo.cs = cs;
e8c27a509894 (svn r9418) -Codechange: Implement actions 1/2/3 for cargos, callback handler and custom icon sprites
peter1138
parents:
diff changeset
    60
7823
cad4dec2b899 (svn r10690) -Codechange: use the enum that describes all callback IDs in favor of "just" using an untyped integer.
rubidium
parents: 7695
diff changeset
    61
	res->callback        = CBID_NO_CALLBACK;
6691
e8c27a509894 (svn r9418) -Codechange: Implement actions 1/2/3 for cargos, callback handler and custom icon sprites
peter1138
parents:
diff changeset
    62
	res->callback_param1 = 0;
e8c27a509894 (svn r9418) -Codechange: Implement actions 1/2/3 for cargos, callback handler and custom icon sprites
peter1138
parents:
diff changeset
    63
	res->callback_param2 = 0;
e8c27a509894 (svn r9418) -Codechange: Implement actions 1/2/3 for cargos, callback handler and custom icon sprites
peter1138
parents:
diff changeset
    64
	res->last_value      = 0;
e8c27a509894 (svn r9418) -Codechange: Implement actions 1/2/3 for cargos, callback handler and custom icon sprites
peter1138
parents:
diff changeset
    65
	res->trigger         = 0;
e8c27a509894 (svn r9418) -Codechange: Implement actions 1/2/3 for cargos, callback handler and custom icon sprites
peter1138
parents:
diff changeset
    66
	res->reseed          = 0;
9252
92e05c28a994 (svn r12452) -Feature: [NewGRF] Add random action 2 type 84. For vehicles only.
glx
parents: 9060
diff changeset
    67
	res->count           = 0;
6691
e8c27a509894 (svn r9418) -Codechange: Implement actions 1/2/3 for cargos, callback handler and custom icon sprites
peter1138
parents:
diff changeset
    68
}
e8c27a509894 (svn r9418) -Codechange: Implement actions 1/2/3 for cargos, callback handler and custom icon sprites
peter1138
parents:
diff changeset
    69
e8c27a509894 (svn r9418) -Codechange: Implement actions 1/2/3 for cargos, callback handler and custom icon sprites
peter1138
parents:
diff changeset
    70
e8c27a509894 (svn r9418) -Codechange: Implement actions 1/2/3 for cargos, callback handler and custom icon sprites
peter1138
parents:
diff changeset
    71
SpriteID GetCustomCargoSprite(const CargoSpec *cs)
e8c27a509894 (svn r9418) -Codechange: Implement actions 1/2/3 for cargos, callback handler and custom icon sprites
peter1138
parents:
diff changeset
    72
{
e8c27a509894 (svn r9418) -Codechange: Implement actions 1/2/3 for cargos, callback handler and custom icon sprites
peter1138
parents:
diff changeset
    73
	const SpriteGroup *group;
e8c27a509894 (svn r9418) -Codechange: Implement actions 1/2/3 for cargos, callback handler and custom icon sprites
peter1138
parents:
diff changeset
    74
	ResolverObject object;
e8c27a509894 (svn r9418) -Codechange: Implement actions 1/2/3 for cargos, callback handler and custom icon sprites
peter1138
parents:
diff changeset
    75
e8c27a509894 (svn r9418) -Codechange: Implement actions 1/2/3 for cargos, callback handler and custom icon sprites
peter1138
parents:
diff changeset
    76
	NewCargoResolver(&object, cs);
e8c27a509894 (svn r9418) -Codechange: Implement actions 1/2/3 for cargos, callback handler and custom icon sprites
peter1138
parents:
diff changeset
    77
e8c27a509894 (svn r9418) -Codechange: Implement actions 1/2/3 for cargos, callback handler and custom icon sprites
peter1138
parents:
diff changeset
    78
	group = Resolve(cs->group, &object);
e8c27a509894 (svn r9418) -Codechange: Implement actions 1/2/3 for cargos, callback handler and custom icon sprites
peter1138
parents:
diff changeset
    79
	if (group == NULL || group->type != SGT_RESULT) return 0;
e8c27a509894 (svn r9418) -Codechange: Implement actions 1/2/3 for cargos, callback handler and custom icon sprites
peter1138
parents:
diff changeset
    80
e8c27a509894 (svn r9418) -Codechange: Implement actions 1/2/3 for cargos, callback handler and custom icon sprites
peter1138
parents:
diff changeset
    81
	return group->g.result.sprite;
e8c27a509894 (svn r9418) -Codechange: Implement actions 1/2/3 for cargos, callback handler and custom icon sprites
peter1138
parents:
diff changeset
    82
}
e8c27a509894 (svn r9418) -Codechange: Implement actions 1/2/3 for cargos, callback handler and custom icon sprites
peter1138
parents:
diff changeset
    83
e8c27a509894 (svn r9418) -Codechange: Implement actions 1/2/3 for cargos, callback handler and custom icon sprites
peter1138
parents:
diff changeset
    84
7823
cad4dec2b899 (svn r10690) -Codechange: use the enum that describes all callback IDs in favor of "just" using an untyped integer.
rubidium
parents: 7695
diff changeset
    85
uint16 GetCargoCallback(CallbackID callback, uint32 param1, uint32 param2, const CargoSpec *cs)
6691
e8c27a509894 (svn r9418) -Codechange: Implement actions 1/2/3 for cargos, callback handler and custom icon sprites
peter1138
parents:
diff changeset
    86
{
e8c27a509894 (svn r9418) -Codechange: Implement actions 1/2/3 for cargos, callback handler and custom icon sprites
peter1138
parents:
diff changeset
    87
	ResolverObject object;
e8c27a509894 (svn r9418) -Codechange: Implement actions 1/2/3 for cargos, callback handler and custom icon sprites
peter1138
parents:
diff changeset
    88
	const SpriteGroup *group;
e8c27a509894 (svn r9418) -Codechange: Implement actions 1/2/3 for cargos, callback handler and custom icon sprites
peter1138
parents:
diff changeset
    89
e8c27a509894 (svn r9418) -Codechange: Implement actions 1/2/3 for cargos, callback handler and custom icon sprites
peter1138
parents:
diff changeset
    90
	NewCargoResolver(&object, cs);
e8c27a509894 (svn r9418) -Codechange: Implement actions 1/2/3 for cargos, callback handler and custom icon sprites
peter1138
parents:
diff changeset
    91
	object.callback = callback;
e8c27a509894 (svn r9418) -Codechange: Implement actions 1/2/3 for cargos, callback handler and custom icon sprites
peter1138
parents:
diff changeset
    92
	object.callback_param1 = param1;
e8c27a509894 (svn r9418) -Codechange: Implement actions 1/2/3 for cargos, callback handler and custom icon sprites
peter1138
parents:
diff changeset
    93
	object.callback_param2 = param2;
e8c27a509894 (svn r9418) -Codechange: Implement actions 1/2/3 for cargos, callback handler and custom icon sprites
peter1138
parents:
diff changeset
    94
e8c27a509894 (svn r9418) -Codechange: Implement actions 1/2/3 for cargos, callback handler and custom icon sprites
peter1138
parents:
diff changeset
    95
	group = Resolve(cs->group, &object);
e8c27a509894 (svn r9418) -Codechange: Implement actions 1/2/3 for cargos, callback handler and custom icon sprites
peter1138
parents:
diff changeset
    96
	if (group == NULL || group->type != SGT_CALLBACK) return CALLBACK_FAILED;
e8c27a509894 (svn r9418) -Codechange: Implement actions 1/2/3 for cargos, callback handler and custom icon sprites
peter1138
parents:
diff changeset
    97
e8c27a509894 (svn r9418) -Codechange: Implement actions 1/2/3 for cargos, callback handler and custom icon sprites
peter1138
parents:
diff changeset
    98
	return group->g.callback.result;
e8c27a509894 (svn r9418) -Codechange: Implement actions 1/2/3 for cargos, callback handler and custom icon sprites
peter1138
parents:
diff changeset
    99
}
6956
0d884da2fd1c (svn r9620) -Codechange: apply cargo translation table to newstation variables 0x60..0x65
peter1138
parents: 6709
diff changeset
   100
0d884da2fd1c (svn r9620) -Codechange: apply cargo translation table to newstation variables 0x60..0x65
peter1138
parents: 6709
diff changeset
   101
8213
fc7a2b3164dd (svn r11252) -Revert r11239, Fix r9620: cargo translation was not done correctly
glx
parents: 7823
diff changeset
   102
CargoID GetCargoTranslation(uint8 cargo, const GRFFile *grffile, bool usebit)
6956
0d884da2fd1c (svn r9620) -Codechange: apply cargo translation table to newstation variables 0x60..0x65
peter1138
parents: 6709
diff changeset
   103
{
0d884da2fd1c (svn r9620) -Codechange: apply cargo translation table to newstation variables 0x60..0x65
peter1138
parents: 6709
diff changeset
   104
	/* Pre-version 7 uses the 'climate dependent' ID, i.e. cargo is the cargo ID */
8213
fc7a2b3164dd (svn r11252) -Revert r11239, Fix r9620: cargo translation was not done correctly
glx
parents: 7823
diff changeset
   105
	if (grffile->grf_version < 7) {
fc7a2b3164dd (svn r11252) -Revert r11239, Fix r9620: cargo translation was not done correctly
glx
parents: 7823
diff changeset
   106
		if (!usebit) return cargo;
fc7a2b3164dd (svn r11252) -Revert r11239, Fix r9620: cargo translation was not done correctly
glx
parents: 7823
diff changeset
   107
		/* Else the cargo value is a 'climate independent' 'bitnum' */
8424
4a488a90ccab (svn r11481) -Codechange: Rename the HASBIT function to fit with the naming style
skidd13
parents: 8213
diff changeset
   108
		if (HasBit(_cargo_mask, cargo)) return GetCargoIDByBitnum(cargo);
8213
fc7a2b3164dd (svn r11252) -Revert r11239, Fix r9620: cargo translation was not done correctly
glx
parents: 7823
diff changeset
   109
	} else {
fc7a2b3164dd (svn r11252) -Revert r11239, Fix r9620: cargo translation was not done correctly
glx
parents: 7823
diff changeset
   110
		/* If the GRF contains a translation table (and the cargo is in bounds)
fc7a2b3164dd (svn r11252) -Revert r11239, Fix r9620: cargo translation was not done correctly
glx
parents: 7823
diff changeset
   111
		 * then get the cargo ID for the label */
fc7a2b3164dd (svn r11252) -Revert r11239, Fix r9620: cargo translation was not done correctly
glx
parents: 7823
diff changeset
   112
		if (cargo < grffile->cargo_max) return GetCargoIDByLabel(grffile->cargo_list[cargo]);
fc7a2b3164dd (svn r11252) -Revert r11239, Fix r9620: cargo translation was not done correctly
glx
parents: 7823
diff changeset
   113
	}
fc7a2b3164dd (svn r11252) -Revert r11239, Fix r9620: cargo translation was not done correctly
glx
parents: 7823
diff changeset
   114
	return CT_INVALID;
6956
0d884da2fd1c (svn r9620) -Codechange: apply cargo translation table to newstation variables 0x60..0x65
peter1138
parents: 6709
diff changeset
   115
}
7695
b15538ba7152 (svn r10477) -Codechange: add some callbacks to customise the acceptance of industries.
rubidium
parents: 7153
diff changeset
   116
b15538ba7152 (svn r10477) -Codechange: add some callbacks to customise the acceptance of industries.
rubidium
parents: 7153
diff changeset
   117
uint8 GetReverseCargoTranslation(CargoID cargo, const GRFFile *grffile)
b15538ba7152 (svn r10477) -Codechange: add some callbacks to customise the acceptance of industries.
rubidium
parents: 7153
diff changeset
   118
{
9060
3bc3c707719b (svn r12142) -Fix [FS#1766]: Callback 0x3D always gets a cargobit in var 0x18, independent of grf version.
frosch
parents: 8424
diff changeset
   119
	/* Note: All grf versions use CargoBit here. Pre-version 7 do NOT use the 'climate dependent' ID. */
7695
b15538ba7152 (svn r10477) -Codechange: add some callbacks to customise the acceptance of industries.
rubidium
parents: 7153
diff changeset
   120
	const CargoSpec *cs = GetCargo(cargo);
b15538ba7152 (svn r10477) -Codechange: add some callbacks to customise the acceptance of industries.
rubidium
parents: 7153
diff changeset
   121
b15538ba7152 (svn r10477) -Codechange: add some callbacks to customise the acceptance of industries.
rubidium
parents: 7153
diff changeset
   122
	/* If the GRF contains a translation table (and the cargo is in the table)
b15538ba7152 (svn r10477) -Codechange: add some callbacks to customise the acceptance of industries.
rubidium
parents: 7153
diff changeset
   123
	 * then get the cargo ID for the label */
b15538ba7152 (svn r10477) -Codechange: add some callbacks to customise the acceptance of industries.
rubidium
parents: 7153
diff changeset
   124
	for (uint i = 0; i < grffile->cargo_max; i++) {
b15538ba7152 (svn r10477) -Codechange: add some callbacks to customise the acceptance of industries.
rubidium
parents: 7153
diff changeset
   125
		if (cs->label == grffile->cargo_list[i]) return i;
b15538ba7152 (svn r10477) -Codechange: add some callbacks to customise the acceptance of industries.
rubidium
parents: 7153
diff changeset
   126
	}
b15538ba7152 (svn r10477) -Codechange: add some callbacks to customise the acceptance of industries.
rubidium
parents: 7153
diff changeset
   127
b15538ba7152 (svn r10477) -Codechange: add some callbacks to customise the acceptance of industries.
rubidium
parents: 7153
diff changeset
   128
	/* No matching label was found, so we return the 'climate independent' 'bitnum' */
b15538ba7152 (svn r10477) -Codechange: add some callbacks to customise the acceptance of industries.
rubidium
parents: 7153
diff changeset
   129
	return cs->bitnum;;
b15538ba7152 (svn r10477) -Codechange: add some callbacks to customise the acceptance of industries.
rubidium
parents: 7153
diff changeset
   130
}