File diff r21382:9d5f35b3c6bb → r21383:942c32fb8b0e
src/ground_vehicle.cpp
Show inline comments
 
@@ -5,24 +5,26 @@
 
 * OpenTTD is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2.
 
 * OpenTTD is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
 
 * See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with OpenTTD. If not, see <http://www.gnu.org/licenses/>.
 
 */
 

	
 
/** @file ground_vehicle.cpp Implementation of GroundVehicle. */
 

	
 
#include "stdafx.h"
 
#include "train.h"
 
#include "roadveh.h"
 
#include "depot_map.h"
 

	
 
#include "safeguards.h"
 

	
 
/**
 
 * Recalculates the cached total power of a vehicle. Should be called when the consist is changed.
 
 */
 
template <class T, VehicleType Type>
 
void GroundVehicle<T, Type>::PowerChanged()
 
{
 
	assert(this->First() == this);
 
	const T *v = T::From(this);
 

	
 
	uint32 total_power = 0;
 
	uint32 max_te = 0;
 
	uint32 number_of_parts = 0;