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 wrap: on
line diff
--- a/growth.c	Wed Jul 23 17:14:38 2008 +0200
+++ b/growth.c	Wed Jul 23 17:40:55 2008 +0200
@@ -1,20 +1,21 @@
 #include <stdio.h>
 #include <stdlib.h>
 #include "db.h"
-#include "game.h"
 
 
-void grow_plants() {
+int grow_plants() {
 	sprintf(query,
 			"update field "
 			"set age = age+1, size = size+1 "
 			);
 	if (!db_update(query)) {
 		db_error("grow plants");
+		return 0;
 	}
+	return 1;
 }
 
 
-void growth(void) {
-	grow_plants();
+int growth(void) {
+	return grow_plants();
 }