Silence uninitialised variable warnings in SSE blitters
[openttd/fttd.git] / src / base_consist.cpp
blob005c886723d6a5bb38b4b111202777c91d825ff6
1 /* $Id$ */
3 /*
4 * This file is part of OpenTTD.
5 * 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.
6 * 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.
7 * 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/>.
8 */
10 /** @file base_consist.cpp Properties for front vehicles/consists. */
12 #include "stdafx.h"
13 #include "base_consist.h"
14 #include "vehicle_base.h"
16 BaseConsist::~BaseConsist()
18 free(this->name);
21 /**
22 * Copy properties of other BaseConsist.
23 * @param src Source for copying
25 void BaseConsist::CopyConsistPropertiesFrom(const BaseConsist *src)
27 if (this == src) return;
29 free(this->name);
30 this->name = src->name != NULL ? strdup(src->name) : NULL;
32 this->current_order_time = src->current_order_time;
33 this->lateness_counter = src->lateness_counter;
34 this->timetable_start = src->timetable_start;
36 this->service_interval = src->service_interval;
38 this->cur_real_order_index = src->cur_real_order_index;
39 this->cur_implicit_order_index = src->cur_implicit_order_index;
41 if (HasBit(src->vehicle_flags, VF_TIMETABLE_STARTED)) SetBit(this->vehicle_flags, VF_TIMETABLE_STARTED);
42 if (HasBit(src->vehicle_flags, VF_AUTOFILL_TIMETABLE)) SetBit(this->vehicle_flags, VF_AUTOFILL_TIMETABLE);
43 if (HasBit(src->vehicle_flags, VF_AUTOFILL_PRES_WAIT_TIME)) SetBit(this->vehicle_flags, VF_AUTOFILL_PRES_WAIT_TIME);