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

Comparing deliantra/server/server/main.C (file contents):
Revision 1.81 by root, Sun Jan 7 02:39:14 2007 UTC vs.
Revision 1.82 by root, Tue Jan 9 01:28:32 2007 UTC

152 152
153 if (contr && map != newmap && map) 153 if (contr && map != newmap && map)
154 if (INVOKE_MAP (LEAVE, map, ARG_PLAYER (contr))) 154 if (INVOKE_MAP (LEAVE, map, ARG_PLAYER (contr)))
155 return; 155 return;
156 156
157 /* If it is a player login, he has yet to be inserted anyplace. 157 // remove, so stupid ob_locked does not trigger a failure
158 * otherwise, we need to deal with removing the player here.
159 */
160 remove (); 158 remove ();
161 159
162 /* try to find a spot for the player */ 160 /* try to find a spot for the player */
163 if (ob_blocked (this, newmap, x, y)) 161 if (ob_blocked (this, newmap, x, y))
164 { /* First choice blocked */ 162 { /* First choice blocked */
201 this->y = y; 199 this->y = y;
202 map = newmap; 200 map = newmap;
203 201
204 insert_ob_in_map (this, map, 0, INS_NO_WALK_ON); 202 insert_ob_in_map (this, map, 0, INS_NO_WALK_ON);
205 203
206 enemy = NULL; 204 enemy = 0;
207 205
208 if (contr) 206 if (contr)
209 { 207 {
210 contr->maplevel = newmap->path; 208 contr->maplevel = newmap->path;
211 contr->count = 0; 209 contr->count = 0;
215 if (type == PLAYER && contr->ranges[range_golem]) 213 if (type == PLAYER && contr->ranges[range_golem])
216 { 214 {
217 int i = find_free_spot (contr->ranges[range_golem], newmap, 215 int i = find_free_spot (contr->ranges[range_golem], newmap,
218 x, y, 1, SIZEOFFREE); 216 x, y, 1, SIZEOFFREE);
219 217
220 contr->ranges[range_golem]->remove ();
221
222 if (i == -1) 218 if (i == -1)
223 { 219 {
224 remove_friendly_object (contr->ranges[range_golem]);
225 contr->ranges[range_golem]->destroy (); 220 contr->ranges[range_golem]->destroy ();
226 contr->ranges[range_golem] = 0; 221 contr->ranges[range_golem] = 0;
227 } 222 }
228 else 223 else
229 { 224 {
230 for (object *tmp = contr->ranges[range_golem]; tmp != NULL; tmp = tmp->more) 225 for (object *tmp = contr->ranges[range_golem]; tmp; tmp = tmp->more)
231 { 226 {
232 tmp->x = x + freearr_x[i] + (tmp->arch ? 0 : tmp->arch->clone.x); 227 tmp->x = x + freearr_x[i] + (tmp->arch ? 0 : tmp->arch->clone.x);
233 tmp->y = y + freearr_y[i] + (tmp->arch ? 0 : tmp->arch->clone.y); 228 tmp->y = y + freearr_y[i] + (tmp->arch ? 0 : tmp->arch->clone.y);
234 tmp->map = newmap; 229 tmp->map = newmap;
235 } 230 }

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines