Files @ r12404:d58b2d050240
Branch filter:

Location: cpp/openttd-patchpack/source/src/ai/api/ai_bridgelist.cpp

alberth
(svn r16848) -Fix: Trying to reduce a nested widget window further than the smallest alowed size should not crash the game.
/* $Id$ */

/** @file ai_bridgelist.cpp Implementation of AIBridgeList and friends. */

#include "ai_bridgelist.hpp"
#include "ai_bridge.hpp"
#include "../../bridge.h"
#include "../../date_func.h"

AIBridgeList::AIBridgeList()
{
	for (byte j = 0; j < MAX_BRIDGES; j++) {
		if (AIBridge::IsValidBridge(j)) this->AddItem(j);
	}
}

AIBridgeList_Length::AIBridgeList_Length(uint length)
{
	for (byte j = 0; j < MAX_BRIDGES; j++) {
		if (AIBridge::IsValidBridge(j)) {
			if (length >= (uint)AIBridge::GetMinLength(j) && length <= (uint)AIBridge::GetMaxLength(j)) this->AddItem(j);
		}
	}
}