(svn r24528) -Fix: [NewGRF] RandomAction 84 should interpret register 100 as signed.

This commit is contained in:
frosch
2012-09-16 16:31:53 +00:00
parent a9167a52db
commit f7ca5d29ed
2 changed files with 24 additions and 4 deletions

View File

@@ -533,6 +533,22 @@ public:
return v;
}
/**
* Get the vehicle at offset \a n of this vehicle chain.
* @param n Offset from the current vehicle.
* @return The new vehicle or NULL if the offset is out-of-bounds.
*/
inline const Vehicle *Move(int n) const
{
const Vehicle *v = this;
if (n < 0) {
for (int i = 0; i != n && v != NULL; i--) v = v->Previous();
} else {
for (int i = 0; i != n && v != NULL; i++) v = v->Next();
}
return v;
}
/**
* Get the first order of the vehicles order list.
* @return first order of order list.