(svn r3579) v->u.rail.first_engine holds an engine type, not a vehicle index, so use INVALID_ENGINE.

This commit is contained in:
peter1138
2006-02-08 19:06:46 +00:00
parent 96cac20318
commit bc0b97ea2f
2 changed files with 3 additions and 3 deletions

View File

@@ -1753,7 +1753,7 @@ static void MaybeReplaceVehicle(Vehicle *v)
temp_cost = ReplaceVehicle(&w, flags);
if (flags & DC_EXEC &&
(w->type != VEH_Train || w->u.rail.first_engine == INVALID_VEHICLE)) {
(w->type != VEH_Train || w->u.rail.first_engine == INVALID_ENGINE)) {
/* now we bought a new engine and sold the old one. We need to fix the
* pointers in order to avoid pointing to the old one for trains: these
* pointers should point to the front engine and not the cars