X-Git-Url: https://git.artsoft.org/?a=blobdiff_plain;f=src%2Flibgame%2Fmisc.c;h=7c8291961ee5a7c8fe2217e70ffce318c1dcc41a;hb=2c03953e712c427c94c02cdb1e15cd9e99e9e116;hp=6fe6949b45e3adc687938977ee4248b491449d5e;hpb=bcb3453f710b95ec98b188b95574bea9ab336e96;p=rocksndiamonds.git diff --git a/src/libgame/misc.c b/src/libgame/misc.c index 6fe6949b..7c829196 100644 --- a/src/libgame/misc.c +++ b/src/libgame/misc.c @@ -159,12 +159,13 @@ boolean FrameReached(unsigned long *frame_counter_var, { unsigned long actual_frame_counter = FrameCounter; - if (actual_frame_counter < *frame_counter_var+frame_delay && + if (actual_frame_counter < *frame_counter_var + frame_delay && actual_frame_counter >= *frame_counter_var) - return(FALSE); + return FALSE; *frame_counter_var = actual_frame_counter; - return(TRUE); + + return TRUE; } boolean DelayReached(unsigned long *counter_var, @@ -174,10 +175,11 @@ boolean DelayReached(unsigned long *counter_var, if (actual_counter < *counter_var + delay && actual_counter >= *counter_var) - return(FALSE); + return FALSE; *counter_var = actual_counter; - return(TRUE); + + return TRUE; } void WaitUntilDelayReached(unsigned long *counter_var, unsigned long delay) @@ -806,7 +808,7 @@ void putFileChunk(FILE *file, char *chunk_name, int chunk_size, void ReadUnusedBytesFromFile(FILE *file, unsigned long bytes) { - while (bytes--) + while (bytes-- && !feof(file)) fgetc(file); }