OpenTTD
base_consist.cpp
Go to the documentation of this file.
1 /* $Id: base_consist.cpp 27280 2015-05-11 16:40:06Z frosch $ */
2 
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  */
9 
12 #include "stdafx.h"
13 #include "base_consist.h"
14 #include "vehicle_base.h"
15 #include "string_func.h"
16 
17 #include "safeguards.h"
18 
19 BaseConsist::~BaseConsist()
20 {
21  free(this->name);
22 }
23 
29 {
30  if (this == src) return;
31 
32  free(this->name);
33  this->name = src->name != NULL ? stredup(src->name) : NULL;
34 
37  this->timetable_start = src->timetable_start;
38 
40 
43 
49  }
51 }