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

Comparing deliantra/server/server/pets.C (file contents):
Revision 1.47 by root, Mon Sep 29 10:20:49 2008 UTC vs.
Revision 1.48 by root, Mon Sep 29 10:31:32 2008 UTC

254 { 254 {
255 object *ob = obl->ob; 255 object *ob = obl->ob;
256 next = obl->next; 256 next = obl->next;
257 257
258 if (ob->owner == owner) 258 if (ob->owner == owner)
259 {
260 op->destroy_inv (true); // be explicit about dropping
261 ob->destroy (true); 259 ob->drop_and_destroy ();
262 }
263 } 260 }
264} 261}
265 262
266/* 263/*
267 * Unfortunately, sometimes, the owner of a pet is in the 264 * Unfortunately, sometimes, the owner of a pet is in the
312 309
313 return 0; 310 return 0;
314 } 311 }
315 } 312 }
316 313
317 ob->destroy_inv (true); // be explicit about dropping 314 ob->drop_and_destroy ();
318 ob->destroy (true);
319 315
320 return 1; 316 return 1;
321} 317}
322 318
323void 319void
329 maptile *m; 325 maptile *m;
330 326
331 /* Check to see if player pulled out */ 327 /* Check to see if player pulled out */
332 if ((owner = ob->owner) == NULL) 328 if ((owner = ob->owner) == NULL)
333 { 329 {
334 op->destroy_inv (true); // be explicit about dropping
335 ob->destroy (true); 330 ob->drop_and_destroy ();
336 LOG (llevMonster, "Pet: no owner, leaving.\n"); 331 LOG (llevMonster, "Pet: no owner, leaving.\n");
337 return; 332 return;
338 } 333 }
339 334
340 /* move monster into the owners map if not in the same map 335 /* move monster into the owners map if not in the same map
538 return; /* Has already been moved */ 533 return; /* Has already been moved */
539 534
540 if (!op->owner) 535 if (!op->owner)
541 { 536 {
542 LOG (llevDebug, "Golem without owner destructed.\n"); 537 LOG (llevDebug, "Golem without owner destructed.\n");
543 op->destroy_inv (true); // be explicit about dropping
544 op->destroy (true); 538 op->drop_and_destroy ();
545 return; 539 return;
546 } 540 }
547 541
548 /* It would be nice to have a cleaner way of what message to print 542 /* It would be nice to have a cleaner way of what message to print
549 * when the golem expires than these hard coded entries. 543 * when the golem expires than these hard coded entries.
553 if (--op->stats.hp < 0) 547 if (--op->stats.hp < 0)
554 { 548 {
555 if (op->msg) 549 if (op->msg)
556 new_draw_info (NDI_UNIQUE, 0, op->owner, op->msg); 550 new_draw_info (NDI_UNIQUE, 0, op->owner, op->msg);
557 551
558 op->destroy_inv (true); // be explicit about dropping
559 op->destroy (true); 552 op->drop_and_destroy ();
560 return; 553 return;
561 } 554 }
562 555
563 /* Do golem attacks/movement for single & multisq golems. 556 /* Do golem attacks/movement for single & multisq golems.
564 * Assuming here that op is the 'head' object. Pass only op to 557 * Assuming here that op is the 'head' object. Pass only op to
651 * 'lose' their old golem. 644 * 'lose' their old golem.
652 */ 645 */
653 if (op->type == PLAYER && op->contr->golem) 646 if (op->type == PLAYER && op->contr->golem)
654 { 647 {
655 new_draw_info (NDI_UNIQUE, 0, op, "You dismiss your existing golem."); 648 new_draw_info (NDI_UNIQUE, 0, op, "You dismiss your existing golem.");
656 op->contr->holem->destroy_inv (true); // be explicit about dropping
657 op->contr->golem->destroy (true); 649 op->contr->golem->drop_and_destroy ();
658 op->contr->golem = 0; 650 op->contr->golem = 0;
659 } 651 }
660 652
661 if (spob->other_arch) 653 if (spob->other_arch)
662 at = spob->other_arch; 654 at = spob->other_arch;

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines