Files
@ r9028:43b29ac0a74d
Branch filter:
Location: cpp/openttd-patchpack/source/src/depot.cpp - annotation
r9028:43b29ac0a74d
1.5 KiB
text/x-c
(svn r12844) -Fix: the industry tick trigger should only be triggered once every 256 ticks, not every tick... Also bail out of the triggers a little earlier if you know they are not going to happen anyway.
r5584:545d748cc681 r5584:545d748cc681 r6125:eb40461cb765 r6125:eb40461cb765 r5584:545d748cc681 r5584:545d748cc681 r8962:cfbdc736c8db r6453:b0b56773284a r5584:545d748cc681 r8784:f3d6ba8eb078 r8131:7a50db7be0ff r8847:d0a2cc468a55 r5584:545d748cc681 r8264:d493cb51fe8a r8264:d493cb51fe8a r7389:43e81eaed707 r5584:545d748cc681 r5584:545d748cc681 r5584:545d748cc681 r5584:545d748cc681 r5584:545d748cc681 r5584:545d748cc681 r5584:545d748cc681 r5584:545d748cc681 r5584:545d748cc681 r5584:545d748cc681 r5584:545d748cc681 r5584:545d748cc681 r5584:545d748cc681 r5584:545d748cc681 r5584:545d748cc681 r5584:545d748cc681 r5584:545d748cc681 r5584:545d748cc681 r5584:545d748cc681 r5584:545d748cc681 r7389:43e81eaed707 r5584:545d748cc681 r7413:3ccdde9800e0 r7413:3ccdde9800e0 r5584:545d748cc681 r7389:43e81eaed707 r5584:545d748cc681 r5584:545d748cc681 r7389:43e81eaed707 r7389:43e81eaed707 r5584:545d748cc681 r5584:545d748cc681 r6247:96e840dbefcc r5584:545d748cc681 r7389:43e81eaed707 r7389:43e81eaed707 r5584:545d748cc681 r5584:545d748cc681 r5584:545d748cc681 r5584:545d748cc681 r5584:545d748cc681 r5584:545d748cc681 r5584:545d748cc681 r5584:545d748cc681 r5584:545d748cc681 r5584:545d748cc681 r6247:96e840dbefcc r5584:545d748cc681 r5584:545d748cc681 r5584:545d748cc681 r5584:545d748cc681 r5584:545d748cc681 r5584:545d748cc681 r5584:545d748cc681 r5584:545d748cc681 r5584:545d748cc681 r6247:96e840dbefcc r5584:545d748cc681 r5584:545d748cc681 r5584:545d748cc681 r5584:545d748cc681 r7389:43e81eaed707 r5584:545d748cc681 r5584:545d748cc681 r5584:545d748cc681 r5584:545d748cc681 r5587:034e5e185dc2 r5584:545d748cc681 r5584:545d748cc681 | /* $Id$ */
/** @file depot.cpp */
#include "stdafx.h"
#include "openttd.h"
#include "depot_base.h"
#include "landscape.h"
#include "saveload.h"
#include "order_func.h"
#include "window_func.h"
#include "oldpool_func.h"
#include "table/strings.h"
DEFINE_OLD_POOL_GENERIC(Depot, Depot)
/**
* Gets a depot from a tile
*
* @return Returns the depot if the tile had a depot, else it returns NULL
*/
Depot *GetDepotByTile(TileIndex tile)
{
Depot *depot;
FOR_ALL_DEPOTS(depot) {
if (depot->xy == tile) return depot;
}
return NULL;
}
/**
* Clean up a depot
*/
Depot::~Depot()
{
if (CleaningPool()) return;
/* Clear the depot from all order-lists */
RemoveOrderFromAllVehicles(OT_GOTO_DEPOT, this->index);
/* Delete the depot-window */
DeleteWindowById(WC_VEHICLE_DEPOT, this->xy);
this->xy = 0;
}
void InitializeDepots()
{
_Depot_pool.CleanPool();
_Depot_pool.AddBlockToPool();
}
static const SaveLoad _depot_desc[] = {
SLE_CONDVAR(Depot, xy, SLE_FILE_U16 | SLE_VAR_U32, 0, 5),
SLE_CONDVAR(Depot, xy, SLE_UINT32, 6, SL_MAX_VERSION),
SLE_VAR(Depot, town_index, SLE_UINT16),
SLE_END()
};
static void Save_DEPT()
{
Depot *depot;
FOR_ALL_DEPOTS(depot) {
SlSetArrayIndex(depot->index);
SlObject(depot, _depot_desc);
}
}
static void Load_DEPT()
{
int index;
while ((index = SlIterateArray()) != -1) {
Depot *depot = new (index) Depot();
SlObject(depot, _depot_desc);
}
}
extern const ChunkHandler _depot_chunk_handlers[] = {
{ 'DEPT', Save_DEPT, Load_DEPT, CH_ARRAY | CH_LAST},
};
|