X-Git-Url: https://git.artsoft.org/?p=rocksndiamonds.git;a=blobdiff_plain;f=src%2Flibgame%2Fsnapshot.c;fp=src%2Flibgame%2Fsnapshot.c;h=43a42c34d50920813717c73314337aba168a6ad8;hp=e05a998c76d5e78aba5163aa6c09c2807059d04a;hb=9fa601d400aa71f38fcdc19eaf107f42e0d2a2a3;hpb=ca2a6ad31f7d41df73e3a45800eb92f7924c446c diff --git a/src/libgame/snapshot.c b/src/libgame/snapshot.c index e05a998c..43a42c34 100644 --- a/src/libgame/snapshot.c +++ b/src/libgame/snapshot.c @@ -86,7 +86,7 @@ void FreeSnapshotBuffers(ListNode *snapshot_buffers) } // ----------------------------------------------------------------------------- -// functions for handling one of several snapshots +// functions for handling single shapshot or list of snapshots // ----------------------------------------------------------------------------- static void FreeSnapshot(void *snapshot_buffers_ptr) @@ -167,7 +167,7 @@ boolean LoadSnapshotSingle() boolean LoadSnapshotFromList_Older(int steps) { - if (snapshot_current->next) + if (snapshot_current && snapshot_current->next) { while (snapshot_current->next && steps--) snapshot_current = snapshot_current->next; @@ -186,7 +186,7 @@ boolean LoadSnapshotFromList_Older(int steps) boolean LoadSnapshotFromList_Newer(int steps) { - if (snapshot_current->prev) + if (snapshot_current && snapshot_current->prev) { while (snapshot_current->prev && steps--) snapshot_current = snapshot_current->prev; @@ -202,3 +202,8 @@ boolean LoadSnapshotFromList_Newer(int steps) return FALSE; } + +boolean CheckSnapshotList() +{ + return (snapshot_list ? TRUE : FALSE); +}