Mercurial > hg > openttd
comparison src/vehicle.cpp @ 17123:a18c14f0bb2b draft
(svn r21860) -Codechange: Rename road vehicle subtype functions to match the train names.
author | terkhen <terkhen@openttd.org> |
---|---|
date | Wed, 19 Jan 2011 18:44:13 +0000 |
parents | 325d6c9a9817 |
children | c62cecf4dade |
comparison
equal
deleted
inserted
replaced
17122:2c811c4c5af1 | 17123:a18c14f0bb2b |
---|---|
627 switch (this->type) { | 627 switch (this->type) { |
628 case VEH_AIRCRAFT: return Aircraft::From(this)->IsNormalAircraft(); // don't count plane shadows and helicopter rotors | 628 case VEH_AIRCRAFT: return Aircraft::From(this)->IsNormalAircraft(); // don't count plane shadows and helicopter rotors |
629 case VEH_TRAIN: | 629 case VEH_TRAIN: |
630 return !Train::From(this)->IsArticulatedPart() && // tenders and other articulated parts | 630 return !Train::From(this)->IsArticulatedPart() && // tenders and other articulated parts |
631 !Train::From(this)->IsRearDualheaded(); // rear parts of multiheaded engines | 631 !Train::From(this)->IsRearDualheaded(); // rear parts of multiheaded engines |
632 case VEH_ROAD: return RoadVehicle::From(this)->IsRoadVehFront(); | 632 case VEH_ROAD: return RoadVehicle::From(this)->IsFrontEngine(); |
633 case VEH_SHIP: return true; | 633 case VEH_SHIP: return true; |
634 default: return false; // Only count company buildable vehicles | 634 default: return false; // Only count company buildable vehicles |
635 } | 635 } |
636 } | 636 } |
637 | 637 |
828 case VEH_SHIP: | 828 case VEH_SHIP: |
829 if (_age_cargo_skip_counter == 0) v->cargo.AgeCargo(); | 829 if (_age_cargo_skip_counter == 0) v->cargo.AgeCargo(); |
830 | 830 |
831 if (v->type == VEH_TRAIN && Train::From(v)->IsWagon()) continue; | 831 if (v->type == VEH_TRAIN && Train::From(v)->IsWagon()) continue; |
832 if (v->type == VEH_AIRCRAFT && v->subtype != AIR_HELICOPTER) continue; | 832 if (v->type == VEH_AIRCRAFT && v->subtype != AIR_HELICOPTER) continue; |
833 if (v->type == VEH_ROAD && !RoadVehicle::From(v)->IsRoadVehFront()) continue; | 833 if (v->type == VEH_ROAD && !RoadVehicle::From(v)->IsFrontEngine()) continue; |
834 | 834 |
835 v->motion_counter += v->cur_speed; | 835 v->motion_counter += v->cur_speed; |
836 /* Play a running sound if the motion counter passes 256 (Do we not skip sounds?) */ | 836 /* Play a running sound if the motion counter passes 256 (Do we not skip sounds?) */ |
837 if (GB(v->motion_counter, 0, 8) < v->cur_speed) PlayVehicleSound(v, VSE_RUNNING); | 837 if (GB(v->motion_counter, 0, 8) < v->cur_speed) PlayVehicleSound(v, VSE_RUNNING); |
838 | 838 |