Fix some daylength issues, possible division by zero in main menu.
[openttd-joker.git] / src / saveload / tbtr_template_replacement_sl.cpp
blobd9b1448ebec0619250dd1e8e662b78503cf97edd
1 #include "../stdafx.h"
3 #include "../tbtr_template_vehicle.h"
5 #include "saveload.h"
7 static const SaveLoad _template_replacement_desc[] = {
8 SLE_VAR(TemplateReplacement, sel_template, SLE_UINT16),
9 SLE_VAR(TemplateReplacement, group, SLE_UINT16),
10 SLE_END()
13 static void Save_TMPL_RPLS()
15 TemplateReplacement *tr;
17 FOR_ALL_TEMPLATE_REPLACEMENTS(tr) {
18 SlSetArrayIndex(tr->index);
19 SlObject(tr, _template_replacement_desc);
23 static void Load_TMPL_RPLS()
25 int index;
27 while ((index = SlIterateArray()) != -1) {
28 TemplateReplacement *tr = new (index) TemplateReplacement();
29 SlObject(tr, _template_replacement_desc);
33 extern const ChunkHandler _template_replacement_chunk_handlers[] = {
34 {'TRPL', Save_TMPL_RPLS, Load_TMPL_RPLS, NULL, NULL, CH_ARRAY | CH_LAST},