Distribute articulated vehicle weight evenly between articulated parts
Instead of allocating it all to the first part This improves realistic braking behaviour for long articulated consists
This commit is contained in:
15
src/train.h
15
src/train.h
@@ -312,6 +312,10 @@ protected: // These functions should not be called outside acceleration code.
|
||||
return 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* Allows to know the weight value that this vehicle will use (excluding cargo).
|
||||
* @return Weight value from the engine in tonnes.
|
||||
*/
|
||||
inline uint16 GetWeightWithoutCargo() const
|
||||
{
|
||||
uint16 weight = 0;
|
||||
@@ -329,13 +333,22 @@ protected: // These functions should not be called outside acceleration code.
|
||||
return weight;
|
||||
}
|
||||
|
||||
/**
|
||||
* Allows to know the weight value that this vehicle will use (cargo only).
|
||||
* @return Weight value from the engine in tonnes.
|
||||
*/
|
||||
inline uint16 GetCargoWeight() const
|
||||
{
|
||||
return this->GetCargoWeight(this->cargo.StoredCount());
|
||||
}
|
||||
|
||||
/**
|
||||
* Allows to know the weight value that this vehicle will use.
|
||||
* @return Weight value from the engine in tonnes.
|
||||
*/
|
||||
inline uint16 GetWeight() const
|
||||
{
|
||||
return this->GetWeightWithoutCargo() + this->GetCargoWeight(this->cargo.StoredCount());
|
||||
return this->GetWeightWithoutCargo() + this->GetCargoWeight();
|
||||
}
|
||||
|
||||
/**
|
||||
|
Reference in New Issue
Block a user