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

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines