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

Comparing deliantra/server/random_maps/wall.C (file contents):
Revision 1.19 by root, Sat Feb 17 23:32:11 2007 UTC vs.
Revision 1.22 by root, Mon Jun 4 12:19:09 2007 UTC

92 * 8 = blocked below 92 * 8 = blocked below
93 */ 93 */
94 94
95 int surround_index = 0; 95 int surround_index = 0;
96 96
97 // don't forget to update the mapspace!
98 if (i > 0) map->at (i - 1, j ).update ();
99 if (i < RP->Xsize - 1) map->at (i + 1, j ).update ();
100 if (j > 0) map->at (i , j - 1).update ();
101 if (j < RP->Ysize - 1) map->at (i , j + 1).update ();
102
97 if ((i > 0) && (GET_MAP_MOVE_BLOCK (map, i - 1, j) & ~MOVE_BLOCK_DEFAULT)) 103 if ((i > 0) && (GET_MAP_MOVE_BLOCK (map, i - 1, j) & MOVE_WALK))
98 surround_index |= 1; 104 surround_index |= 1;
99 if ((i < RP->Xsize - 1) && (GET_MAP_MOVE_BLOCK (map, i + 1, j) & ~MOVE_BLOCK_DEFAULT)) 105 if ((i < RP->Xsize - 1) && (GET_MAP_MOVE_BLOCK (map, i + 1, j) & MOVE_WALK))
100 surround_index |= 2; 106 surround_index |= 2;
101 if ((j > 0) && (GET_MAP_MOVE_BLOCK (map, i, j - 1) & ~MOVE_BLOCK_DEFAULT)) 107 if ((j > 0) && (GET_MAP_MOVE_BLOCK (map, i, j - 1) & MOVE_WALK))
102 surround_index |= 4; 108 surround_index |= 4;
103 if ((j < RP->Ysize - 1) && (GET_MAP_MOVE_BLOCK (map, i, j + 1) & ~MOVE_BLOCK_DEFAULT)) 109 if ((j < RP->Ysize - 1) && (GET_MAP_MOVE_BLOCK (map, i, j + 1) & MOVE_WALK))
104 surround_index |= 8; 110 surround_index |= 8;
105 111
106 return surround_index; 112 return surround_index;
107} 113}
108 114
155 int i, j; 161 int i, j;
156 char *cp; 162 char *cp;
157 int joinedwalls = 0; 163 int joinedwalls = 0;
158 object *thiswall; 164 object *thiswall;
159 165
160 sprintf (RP->wall_name, "%s", &the_wall->arch->name); 166 sprintf (RP->wall_name, "%s", &the_wall->arch->archname);
161 if ((cp = strchr (RP->wall_name, '_')) != NULL) 167 if ((cp = strchr (RP->wall_name, '_')) != NULL)
162 { 168 {
163 *cp = 0; 169 *cp = 0;
164 joinedwalls = 1; 170 joinedwalls = 1;
165 } 171 }
196 int surround_index = 0; 202 int surround_index = 0;
197 int l; 203 int l;
198 char wall_name[1024]; 204 char wall_name[1024];
199 archetype *wall_arch = 0; 205 archetype *wall_arch = 0;
200 206
201 assign (wall_name, the_wall->arch->name); 207 assign (wall_name, the_wall->arch->archname);
202 208
203 /* conventionally, walls are named like this: 209 /* conventionally, walls are named like this:
204 wallname_wallcode, where wallcode indicates 210 wallname_wallcode, where wallcode indicates
205 a joinedness, and wallname is the wall. 211 a joinedness, and wallname is the wall.
206 this code depends on the convention for 212 this code depends on the convention for

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines