comparison growth.c @ 17:5e6c9260913a

lots of cleanups and small fixes
author meillo@marmaro.de
date Wed, 23 Jul 2008 17:14:38 +0200
parents 8db6497d6065
children 5937504619f2
comparison
equal deleted inserted replaced
16:3c104b5f5158 17:5e6c9260913a
3 #include "db.h" 3 #include "db.h"
4 #include "game.h" 4 #include "game.h"
5 5
6 6
7 void grow_plants() { 7 void grow_plants() {
8 /* get weather and last environments to calculate the next one */ 8 sprintf(query,
9 sprintf(query, "update field \ 9 "update field "
10 set age = age+1, size = size+1 "); 10 "set age = age+1, size = size+1 "
11 stmt = db_query(query); 11 );
12 if (!db_update(query)) { 12 if (!db_update(query)) {
13 printf("E: update failed ++ %s\n", sqlite3_errmsg(db)); 13 db_error("grow plants");
14 } 14 }
15 sqlite3_finalize(stmt);
16 } 15 }
17 16
18 17
19 void growth(void) { 18 void growth(void) {
20 grow_plants(); 19 grow_plants();