# waypoint_sl.cpp File Reference

Code handling saving and loading of waypoints. More...

`#include "../stdafx.h"`
`#include "../waypoint.h"`
`#include "../newgrf_station.h"`
`#include "../town.h"`
`#include "table/strings.h"`
`#include "saveload.h"`

Go to the source code of this file.

## Functions
void | AfterLoadWaypoints ()
| Update waypoint graphics id against saved GRFID/localidx.
void | FixOldWaypoints ()
| Fix savegames which stored waypoints in their old format.
static void | Save_WAYP ()
static void | Load_WAYP ()
## Variables
static const SaveLoad | _waypoint_desc []
const ChunkHandler | _waypoint_chunk_handlers []

## Detailed Description

Code handling saving and loading of waypoints.

Definition in file waypoint_sl.cpp.

## Function Documentation

void AfterLoadWaypoints | ( |  | ) |

Update waypoint graphics id against saved GRFID/localidx.

This is to ensure the chosen graphics are correct if GRF files are changed.

Definition at line 18 of file waypoint_sl.cpp.

References GetCustomStationSpec(), GetNumCustomStations(), and STAT_CLASS_WAYP.

Referenced by ReloadNewGRFData().

## Variable Documentation

const ChunkHandler _waypoint_chunk_handlers[]

Initial value:

     {
      { 'CHKP', Save_WAYP, Load_WAYP, CH_ARRAY | CH_LAST},
    }

const SaveLoad _waypoint_desc[]`[static]`

Initial value:

     {
      SLE_CONDVAR(Waypoint, xy,         SLE_FILE_U16 | SLE_VAR_U32,  0, 5),
      SLE_CONDVAR(Waypoint, xy,         SLE_UINT32,                  6, SL_MAX_VERSION),
      SLE_CONDVAR(Waypoint, town_index, SLE_UINT16,                 12, SL_MAX_VERSION),
      SLE_CONDVAR(Waypoint, town_cn,    SLE_FILE_U8 | SLE_VAR_U16,  12, 88),
      SLE_CONDVAR(Waypoint, town_cn,    SLE_UINT16,                 89, SL_MAX_VERSION),
      SLE_CONDVAR(Waypoint, string,     SLE_STRINGID,                0, 83),
      SLE_CONDSTR(Waypoint, name,       SLE_STR, 0,                 84, SL_MAX_VERSION),
          SLE_VAR(Waypoint, deleted,    SLE_UINT8),

      SLE_CONDVAR(Waypoint, build_date, SLE_FILE_U16 | SLE_VAR_I32,  3, 30),
      SLE_CONDVAR(Waypoint, build_date, SLE_INT32,                  31, SL_MAX_VERSION),
      SLE_CONDVAR(Waypoint, localidx,   SLE_UINT8,                   3, SL_MAX_VERSION),
      SLE_CONDVAR(Waypoint, grfid,      SLE_UINT32,                 17, SL_MAX_VERSION),
      SLE_CONDVAR(Waypoint, owner,      SLE_UINT8,                 101, SL_MAX_VERSION),

    }

Definition at line 55 of file waypoint_sl.cpp.