garten

diff growth.c @ 18:5937504619f2

rename game.h -> modules.h; added some error handling; and more
author meillo@marmaro.de
date Wed, 23 Jul 2008 17:40:55 +0200
parents 5e6c9260913a
children
line diff
     1.1 --- a/growth.c	Wed Jul 23 17:14:38 2008 +0200
     1.2 +++ b/growth.c	Wed Jul 23 17:40:55 2008 +0200
     1.3 @@ -1,20 +1,21 @@
     1.4  #include <stdio.h>
     1.5  #include <stdlib.h>
     1.6  #include "db.h"
     1.7 -#include "game.h"
     1.8  
     1.9  
    1.10 -void grow_plants() {
    1.11 +int grow_plants() {
    1.12  	sprintf(query,
    1.13  			"update field "
    1.14  			"set age = age+1, size = size+1 "
    1.15  			);
    1.16  	if (!db_update(query)) {
    1.17  		db_error("grow plants");
    1.18 +		return 0;
    1.19  	}
    1.20 +	return 1;
    1.21  }
    1.22  
    1.23  
    1.24 -void growth(void) {
    1.25 -	grow_plants();
    1.26 +int growth(void) {
    1.27 +	return grow_plants();
    1.28  }