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

Comparing deliantra/server/random_maps/style.C (file contents):
Revision 1.10 by root, Wed Dec 27 09:28:02 2006 UTC vs.
Revision 1.11 by root, Wed Dec 27 13:13:47 2006 UTC

116load_style_map (char *style_name) 116load_style_map (char *style_name)
117{ 117{
118 maptile *style_map; 118 maptile *style_map;
119 119
120 /* Given a file. See if its in memory */ 120 /* Given a file. See if its in memory */
121 for (style_map = styles; style_map != NULL; style_map = style_map->next) 121 for (style_map = styles; style_map; style_map = style_map->next)
122 if (!strcmp (style_name, style_map->path)) 122 if (!strcmp (style_name, style_map->path))
123 return style_map; 123 return style_map;
124 124
125 style_map = load_original_map (style_name, MAP_STYLE); 125 style_map = load_original_map (style_name, MAP_STYLE);
126 126
127 /* Remove it from global list, put it on our local list */ 127 /* Remove it from global list, put it on our local list */
128 if (style_map) 128 if (style_map)
129 { 129 {
130 maptile *tmp; 130 style_map->unlink ();
131
132 if (style_map == first_map)
133 first_map = style_map->next;
134 else
135 {
136 for (tmp = first_map; tmp && tmp->next != style_map; tmp = tmp->next);
137 if (tmp)
138 tmp->next = style_map->next;
139 }
140 131
141 style_map->next = styles; 132 style_map->next = styles;
142 styles = style_map; 133 styles = style_map;
143 } 134 }
144 135

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines