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.95 by root, Sat Mar 17 22:11:23 2007 UTC vs.
Revision 1.96 by root, Sat Apr 21 16:56:32 2007 UTC

327 LOG (llevError, "BUG: process_events(): Free object on list\n"); 327 LOG (llevError, "BUG: process_events(): Free object on list\n");
328 op->set_speed (0); 328 op->set_speed (0);
329 continue; 329 continue;
330 } 330 }
331 331
332 /* I've seen occasional crashes due to this - the object is removed,
333 * and thus the map it points to (last map it was on) may be bogus
334 * The real bug is to try to find out the cause of this - someone
335 * is probably calling remove_ob without either an insert_ob or
336 * free_object afterwards, leaving an object dangling. But I'd
337 * rather log this and continue on instead of crashing.
338 * Don't remove players - when a player quits, the object is in
339 * sort of a limbo, of removed, but something we want to keep
340 * around.
341 */
342 if (QUERY_FLAG (op, FLAG_REMOVED) && op->type != PLAYER && op->map && op->map->in_memory != MAP_IN_MEMORY)
343 {
344 LOG (llevError, "BUG: process_events(): Removed object on list\n");
345 char *dump = dump_object (op);
346 LOG (llevError, dump);
347 free (dump);
348 op->destroy ();
349 continue;
350 }
351
352 if (!op->has_active_speed ()) 332 if (!op->has_active_speed ())
353 { 333 {
354 LOG (llevError, "BUG: process_events(): Object %s has no speed (%f), " 334 LOG (llevError, "BUG: process_events(): Object %s has no speed (%f), "
355 "but is on active list\n", op->debug_desc (), op->speed); 335 "but is on active list\n", op->debug_desc (), op->speed);
356 op->set_speed (0); 336 op->set_speed (0);
357 continue; 337 continue;
358 } 338 }
359 339
360 if (op->map == NULL && op->env == NULL && op->name && op->type != MAP) 340 if (op->flag [FLAG_REMOVED])
361 { 341 {
362 LOG (llevError, "BUG: process_events(): Object without map or " 342 LOG (llevError, "BUG: process_events(): removed object is on active list: %s\n",
363 "inventory is on active list: %s (%d)\n", &op->name, op->count); 343 op->debug_desc ());
364 op->set_speed (0); 344 op->set_speed (0);
365 continue; 345 continue;
366 } 346 }
367 347
368 /* Animate the object. Bug or feature that anim_speed 348 /* Animate the object. Bug or feature that anim_speed

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines