ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/deliantra/server/server/weather.C
(Generate patch)

Comparing deliantra/server/server/weather.C (file contents):
Revision 1.1 by elmex, Sun Aug 13 17:16:05 2006 UTC vs.
Revision 1.2 by root, Sat Aug 26 23:36:35 2006 UTC

1/* 1/*
2 * static char *rcsid_weather_c = 2 * static char *rcsid_weather_c =
3 * "$Id: weather.C,v 1.1 2006/08/13 17:16:05 elmex Exp $"; 3 * "$Id: weather.C,v 1.2 2006/08/26 23:36:35 root Exp $";
4 */ 4 */
5/* 5/*
6 CrossFire, A Multiplayer game for X-windows 6 CrossFire, A Multiplayer game for X-windows
7 7
8 Copyright (C) 2002 Tim Rightnour 8 Copyright (C) 2002 Tim Rightnour
1631 free_object(tmp); 1631 free_object(tmp);
1632 } 1632 }
1633 } 1633 }
1634 } 1634 }
1635 if (at != NULL) { 1635 if (at != NULL) {
1636 ob = get_object(); 1636 ob = arch_to_object (at);
1637 copy_object(&at->clone, ob);
1638 ob->x = x; 1637 ob->x = x;
1639 ob->y = y; 1638 ob->y = y;
1640 ob->material = M_ICE; 1639 ob->material = M_ICE;
1641 SET_FLAG(ob, FLAG_OVERLAY_FLOOR); 1640 SET_FLAG(ob, FLAG_OVERLAY_FLOOR);
1642 CLEAR_FLAG(ob, FLAG_IS_FLOOR); 1641 CLEAR_FLAG(ob, FLAG_IS_FLOOR);
1644 INS_NO_MERGE | INS_NO_WALK_ON | INS_ABOVE_FLOOR_ONLY); 1643 INS_NO_MERGE | INS_NO_WALK_ON | INS_ABOVE_FLOOR_ONLY);
1645 if (two) { 1644 if (two) {
1646 at = NULL; 1645 at = NULL;
1647 at = find_archetype(doublestack); 1646 at = find_archetype(doublestack);
1648 if (at != NULL) { 1647 if (at != NULL) {
1649 ob = get_object(); 1648 ob = arch_to_object (at);
1650 copy_object(&at->clone, ob);
1651 ob->x = x; 1649 ob->x = x;
1652 ob->y = y; 1650 ob->y = y;
1653 insert_ob_in_map(ob, m, ob, 1651 insert_ob_in_map(ob, m, ob,
1654 INS_NO_MERGE | INS_NO_WALK_ON | INS_ON_TOP); 1652 INS_NO_MERGE | INS_NO_WALK_ON | INS_ON_TOP);
1655 } 1653 }
1679 at = find_archetype("mountain2_rivlets");} 1677 at = find_archetype("mountain2_rivlets");}
1680 else if (tmp && (!strcmp(tmp->arch->name, "mountain4"))){ 1678 else if (tmp && (!strcmp(tmp->arch->name, "mountain4"))){
1681 at = find_archetype("mountain2_rivlets");} 1679 at = find_archetype("mountain2_rivlets");}
1682 else {at = find_archetype("rain5");} 1680 else {at = find_archetype("rain5");}
1683 if (at != NULL) { 1681 if (at != NULL) {
1684 ob = get_object(); 1682 ob = arch_to_object (at);
1685 copy_object(&at->clone, ob);
1686 ob->x = x; 1683 ob->x = x;
1687 ob->y = y; 1684 ob->y = y;
1688 SET_FLAG(ob, FLAG_OVERLAY_FLOOR); 1685 SET_FLAG(ob, FLAG_OVERLAY_FLOOR);
1689 ob->material = M_LIQUID; 1686 ob->material = M_LIQUID;
1690 insert_ob_in_map(ob, m, ob, INS_NO_MERGE | 1687 insert_ob_in_map(ob, m, ob, INS_NO_MERGE |
1709 avoid++; 1706 avoid++;
1710 else if (tmp && (!strcasecmp(tmp->name, "shallow_sea"))) 1707 else if (tmp && (!strcasecmp(tmp->name, "shallow_sea")))
1711 avoid++; 1708 avoid++;
1712 if (avoid > 0) { 1709 if (avoid > 0) {
1713 at = find_archetype("ice"); 1710 at = find_archetype("ice");
1714 ob = get_object(); 1711 ob = arch_to_object (at);
1715 copy_object(&at->clone, ob);
1716 ob->x = x; 1712 ob->x = x;
1717 ob->y = y; 1713 ob->y = y;
1718 insert_ob_in_map(ob, m, ob, 1714 insert_ob_in_map(ob, m, ob,
1719 INS_NO_MERGE | INS_NO_WALK_ON | INS_ABOVE_FLOOR_ONLY); 1715 INS_NO_MERGE | INS_NO_WALK_ON | INS_ABOVE_FLOOR_ONLY);
1720 } 1716 }
1862 free_object(tmp); 1858 free_object(tmp);
1863 } 1859 }
1864 } 1860 }
1865 } 1861 }
1866 if (at != NULL) { 1862 if (at != NULL) {
1867 ob = get_object(); 1863 ob = arch_to_object (at);
1868 copy_object(&at->clone, ob);
1869 ob->x = x; 1864 ob->x = x;
1870 ob->y = y; 1865 ob->y = y;
1871 SET_FLAG(ob, FLAG_OVERLAY_FLOOR); 1866 SET_FLAG(ob, FLAG_OVERLAY_FLOOR);
1872 ob->material = M_LIQUID; 1867 ob->material = M_LIQUID;
1873 insert_ob_in_map(ob, m, ob, 1868 insert_ob_in_map(ob, m, ob,
1874 INS_NO_MERGE | INS_NO_WALK_ON | INS_ABOVE_FLOOR_ONLY); 1869 INS_NO_MERGE | INS_NO_WALK_ON | INS_ABOVE_FLOOR_ONLY);
1875 if (two) { 1870 if (two) {
1876 at = find_archetype(doublestack); 1871 at = find_archetype(doublestack);
1877 if (at != NULL) { 1872 if (at != NULL) {
1878 ob = get_object(); 1873 ob = arch_to_object (at);
1879 copy_object(&at->clone, ob);
1880 ob->x = x; 1874 ob->x = x;
1881 ob->y = y; 1875 ob->y = y;
1882 insert_ob_in_map(ob, m, ob, 1876 insert_ob_in_map(ob, m, ob,
1883 INS_NO_MERGE | INS_NO_WALK_ON | INS_ON_TOP); 1877 INS_NO_MERGE | INS_NO_WALK_ON | INS_ON_TOP);
1884 } 1878 }
2026 /* we got this far.. must be a match */ 2020 /* we got this far.. must be a match */
2027 at = find_archetype(weather_grow[i].herb); 2021 at = find_archetype(weather_grow[i].herb);
2028 break; 2022 break;
2029 } 2023 }
2030 if (at != NULL) { 2024 if (at != NULL) {
2031 ob = get_object(); 2025 ob = arch_to_object (at);
2032 copy_object(&at->clone, ob);
2033 ob->x = x; 2026 ob->x = x;
2034 ob->y = y; 2027 ob->y = y;
2035 /* XXX is this right? maybe.. */ 2028 /* XXX is this right? maybe.. */
2036 SET_FLAG(ob, FLAG_OVERLAY_FLOOR); 2029 SET_FLAG(ob, FLAG_OVERLAY_FLOOR);
2037 insert_ob_in_map(ob, m, ob, 2030 insert_ob_in_map(ob, m, ob,
2150 if (weather_tile[i].tile != NULL && GET_MAP_OB(m, x, y) && 2143 if (weather_tile[i].tile != NULL && GET_MAP_OB(m, x, y) &&
2151 strcmp(weather_tile[i].tile, 2144 strcmp(weather_tile[i].tile,
2152 GET_MAP_OB(m, x, y)->arch->name) != 0) 2145 GET_MAP_OB(m, x, y)->arch->name) != 0)
2153 dat = find_archetype(weather_tile[i].tile); 2146 dat = find_archetype(weather_tile[i].tile);
2154 if (dat != NULL) { 2147 if (dat != NULL) {
2155 ob = get_object(); 2148 ob = arch_to_object (dat);
2156 copy_object(&dat->clone, ob);
2157 ob->x = x; 2149 ob->x = x;
2158 ob->y = y; 2150 ob->y = y;
2159 insert_ob_in_map(ob, m, ob, 2151 insert_ob_in_map(ob, m, ob,
2160 INS_NO_MERGE | INS_NO_WALK_ON | INS_ABOVE_FLOOR_ONLY); 2152 INS_NO_MERGE | INS_NO_WALK_ON | INS_ABOVE_FLOOR_ONLY);
2161 } 2153 }
2162 if (gotsnow == 0) { 2154 if (gotsnow == 0) {
2163 ob = get_object(); 2155 ob = arch_to_object (at);
2164 copy_object(&at->clone, ob);
2165 ob->x = x; 2156 ob->x = x;
2166 ob->y = y; 2157 ob->y = y;
2167 if (dat != NULL) 2158 if (dat != NULL)
2168 insert_ob_in_map(ob, m, ob, 2159 insert_ob_in_map(ob, m, ob,
2169 INS_NO_MERGE | INS_NO_WALK_ON | INS_ON_TOP); 2160 INS_NO_MERGE | INS_NO_WALK_ON | INS_ON_TOP);
2252 } 2243 }
2253 } 2244 }
2254 } else { 2245 } else {
2255 continue; 2246 continue;
2256 } 2247 }
2257 ob = get_object(); 2248 ob = arch_to_object (ntopfloor->arch);
2258 copy_object(&ntopfloor->arch->clone, ob);
2259 ob->x = x; 2249 ob->x = x;
2260 ob->y = y; 2250 ob->y = y;
2261 insert_ob_in_map(ob, m, ob, INS_NO_MERGE | INS_NO_WALK_ON | INS_ABOVE_FLOOR_ONLY); 2251 insert_ob_in_map(ob, m, ob, INS_NO_MERGE | INS_NO_WALK_ON | INS_ABOVE_FLOOR_ONLY);
2262 if (ntmp != NULL && nodstk == 0) { 2252 if (ntmp != NULL && nodstk == 0) {
2263 for (i=0; weather_tile[i].herb != NULL; i++) { 2253 for (i=0; weather_tile[i].herb != NULL; i++) {
2264 if (strcmp(ntmp->arch->name, weather_tile[i].herb) == 0) { 2254 if (strcmp(ntmp->arch->name, weather_tile[i].herb) == 0) {
2265 ob = get_object(); 2255 ob = arch_to_object (ntmp->arch);
2266 copy_object(&ntmp->arch->clone, ob);
2267 ob->x = x; 2256 ob->x = x;
2268 ob->y = y; 2257 ob->y = y;
2269 insert_ob_in_map(ob, m, ob, INS_NO_MERGE | INS_NO_WALK_ON | INS_ON_TOP); 2258 insert_ob_in_map(ob, m, ob, INS_NO_MERGE | INS_NO_WALK_ON | INS_ON_TOP);
2270 break; 2259 break;
2271 } 2260 }

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines