version 1.43 | | version 1.44 |
---|
| | |
/* | | /* |
* static char *rcsid_weather_c = | | * static char *rcsid_weather_c = |
* "$Id: weather.c,v 1.43 2005/11/01 09:02:55 akirschbaum Exp $"; | | * "$Id: weather.c,v 1.44 2005/11/27 14:16:46 ryo_saeba Exp $"; |
*/ | | */ |
/* | | /* |
CrossFire, A Multiplayer game for X-windows | | CrossFire, A Multiplayer game for X-windows |
| | |
/* perform_weather must follow calculators */ | | /* perform_weather must follow calculators */ |
perform_weather(); | | perform_weather(); |
if (settings.dynamiclevel > 0) { | | if (settings.dynamiclevel > 0) { |
write_weather_images(); | | /* write_weather_images();*/ |
spin_globe(); | | spin_globe(); |
} | | } |
} | | } |
| | |
if (wmperformstarty == settings.worldmaptilesy) | | if (wmperformstarty == settings.worldmaptilesy) |
wmperformstartx = wmperformstarty = 0; | | wmperformstartx = wmperformstarty = 0; |
| | |
| | wmperformstartx = 3;
|
| | wmperformstarty = 27;
|
| | |
sprintf(filename, "world/world_%d_%d", | | sprintf(filename, "world/world_%d_%d", |
wmperformstartx+settings.worldmapstartx, | | wmperformstartx+settings.worldmapstartx, |
wmperformstarty+settings.worldmapstarty); | | wmperformstarty+settings.worldmapstarty); |
| | |
if (!strcmp(oldsnow->arch->name, at->name)) | | if (!strcmp(oldsnow->arch->name, at->name)) |
at = NULL; | | at = NULL; |
else { | | else { |
| | if (!strcmp(oldsnow->name,"grass")) {
|
| | LOG(llevError,"grass");
|
| | } |
remove_ob(oldsnow); | | remove_ob(oldsnow); |
free_object(oldsnow); | | free_object(oldsnow); |
tmp=GET_MAP_OB(m, x, y); | | tmp=GET_MAP_OB(m, x, y); |
| | |
} | | } |
if (tmp != NULL && doublestack2 != NULL) | | if (tmp != NULL && doublestack2 != NULL) |
if (strcmp(tmp->arch->name, doublestack2) == 0) { | | if (strcmp(tmp->arch->name, doublestack2) == 0) { |
| | if (!strcmp(tmp->name,"grass")) {
|
| | LOG(llevError,"grass");
|
| | } |
remove_ob(tmp); | | remove_ob(tmp); |
free_object(tmp); | | free_object(tmp); |
} | | } |
| | |
} | | } |
if (avoid) { | | if (avoid) { |
/* replace snow with a big puddle */ | | /* replace snow with a big puddle */ |
| | if (!strcmp(tmp->name,"grass")) {
|
| | LOG(llevError,"grass");
|
| | } |
remove_ob(tmp); | | remove_ob(tmp); |
free_object(tmp); | | free_object(tmp); |
tmp=GET_MAP_OB(m, x, y); | | tmp=GET_MAP_OB(m, x, y); |
| | |
at = NULL; | | at = NULL; |
else { | | else { |
tmp=GET_MAP_OB(m, x, y); | | tmp=GET_MAP_OB(m, x, y); |
| | if (!strcmp(oldsnow->name,"grass")) {
|
| | LOG(llevError,"grass");
|
| | }
|
remove_ob(oldsnow); | | remove_ob(oldsnow); |
/* clean up the trees we put over the snow */ | | /* clean up the trees we put over the snow */ |
found = 0; | | found = 0; |
| | |
free_object(oldsnow); | | free_object(oldsnow); |
if (tmp != NULL && doublestack2 != NULL) | | if (tmp != NULL && doublestack2 != NULL) |
if (strcmp(tmp->arch->name, doublestack2) == 0) { | | if (strcmp(tmp->arch->name, doublestack2) == 0) { |
| | if (!strcmp(tmp->name,"grass")) {
|
| | LOG(llevError,"grass");
|
| | } |
remove_ob(tmp); | | remove_ob(tmp); |
free_object(tmp); | | free_object(tmp); |
} | | } |
| | |
ob->y = y; | | ob->y = y; |
SET_FLAG(ob, FLAG_OVERLAY_FLOOR); | | SET_FLAG(ob, FLAG_OVERLAY_FLOOR); |
ob->material = M_LIQUID; | | ob->material = M_LIQUID; |
| | if ( x == 10 && y == 10 )
|
| | {
|
| | x = x;
|
| | } |
insert_ob_in_map(ob, m, ob, | | insert_ob_in_map(ob, m, ob, |
INS_NO_MERGE | INS_NO_WALK_ON | INS_ABOVE_FLOOR_ONLY); | | INS_NO_MERGE | INS_NO_WALK_ON | INS_ABOVE_FLOOR_ONLY); |
if (two) { | | if (two) { |
| | |
copy_object(&at->clone, ob); | | copy_object(&at->clone, ob); |
ob->x = x; | | ob->x = x; |
ob->y = y; | | ob->y = y; |
| | if ( x == 10 && y == 10 )
|
| | {
|
| | x = x;
|
| | } |
insert_ob_in_map(ob, m, ob, | | insert_ob_in_map(ob, m, ob, |
INS_NO_MERGE | INS_NO_WALK_ON | INS_ON_TOP); | | INS_NO_MERGE | INS_NO_WALK_ON | INS_ON_TOP); |
} | | } |
| | |
else if (!strcmp(tmp->arch->name, "mountain2_rivlets")) | | else if (!strcmp(tmp->arch->name, "mountain2_rivlets")) |
avoid++; | | avoid++; |
if (avoid) { | | if (avoid) { |
| | if (!strcmp(tmp->name,"grass")) {
|
| | LOG(llevError,"grass");
|
| | }
|
remove_ob(tmp); | | remove_ob(tmp); |
free_object(tmp); | | free_object(tmp); |
if (weathermap[wx][wy].humid < 100 && rndm(0, 50) == 0) | | if (weathermap[wx][wy].humid < 100 && rndm(0, 50) == 0) |
| | |
} | | } |
if (tmp != NULL && doublestack2 != NULL) | | if (tmp != NULL && doublestack2 != NULL) |
if (strcmp(tmp->arch->name, doublestack2) == 0) { | | if (strcmp(tmp->arch->name, doublestack2) == 0) { |
| | if (!strcmp(tmp->name,"grass")) {
|
| | LOG(llevError,"grass");
|
| | } |
remove_ob(tmp); | | remove_ob(tmp); |
free_object(tmp); | | free_object(tmp); |
} | | } |
| | |
rndm(0, MIN(weather_grow[i].random/2, 1)) == 0) { | | rndm(0, MIN(weather_grow[i].random/2, 1)) == 0) { |
/* the herb does not belong, randomly delete | | /* the herb does not belong, randomly delete |
herbs to prevent overgrowth. */ | | herbs to prevent overgrowth. */ |
| | if (!strcmp(tmp->name,"grass")) {
|
| | LOG(llevError,"grass");
|
| | }
|
remove_ob(tmp); | | remove_ob(tmp); |
free_object(tmp); | | free_object(tmp); |
break; | | break; |
| | |
weathermap[wx][wy].humid > weather_tile[i].humax || | | weathermap[wx][wy].humid > weather_tile[i].humax || |
temp < weather_tile[i].tempmin || | | temp < weather_tile[i].tempmin || |
temp > weather_tile[i].tempmax) { | | temp > weather_tile[i].tempmax) { |
| | if (!strcmp(tmp->name,"grass") && tmp->x == 10 && tmp->y == 10) {
|
| | LOG(llevError,"grass");
|
| | } |
remove_ob(tmp); | | remove_ob(tmp); |
free_object(tmp); | | free_object(tmp); |
if (doublestack) { | | if (doublestack) { |
| | if (!strcmp(doublestack->name,"grass")) {
|
| | LOG(llevError,"grass");
|
| | }
|
remove_ob(doublestack); | | remove_ob(doublestack); |
free_object(doublestack); | | free_object(doublestack); |
} | | } |