|
From: <cro...@li...> - 2002-12-28 06:35:26
|
Module Name: crossfire
Committed By: garbled
Date: Sat Dec 28 06:35:23 UTC 2002
Modified Files:
crossfire/server: spell_effect.c
Log Message:
Fix some stupidity in summon_pet that made it not work above level 25 or so.
Start of context diffs
Index: crossfire/server/spell_effect.c
diff -c crossfire/server/spell_effect.c:1.87 crossfire/server/spell_effect.c:1.88
*** crossfire/server/spell_effect.c:1.87 Sat Dec 21 00:02:34 2002
--- crossfire/server/spell_effect.c Fri Dec 27 22:35:23 2002
***************
*** 1,6 ****
/*
* static char *rcsid_spell_effect_c =
! * "$Id: spell_effect.c,v 1.87 2002/12/21 08:02:34 mwedel Exp $";
*/
--- 1,6 ----
/*
* static char *rcsid_spell_effect_c =
! * "$Id: spell_effect.c,v 1.88 2002/12/28 06:35:23 garbled Exp $";
*/
***************
*** 1754,1760 ****
int summon_pet(object *op, int dir, SpellTypeFrom item) {
int level, number, i;
treasurelist *trlist = NULL;
! treasure *tr, *prevtr = NULL;
level = ((op->head?op->head->level:SK_level(op)) / 4);
--- 1754,1760 ----
int summon_pet(object *op, int dir, SpellTypeFrom item) {
int level, number, i;
treasurelist *trlist = NULL;
! treasure *tr = NULL;
level = ((op->head?op->head->level:SK_level(op)) / 4);
***************
*** 1773,1792 ****
if (trlist == NULL)
return 0;
! for (i=0, tr=trlist->items; tr != NULL && i < level-1;
! prevtr = tr, tr = tr->next, i++);
! if(prevtr == NULL || prevtr->item == NULL) {
LOG(llevError,"Treasurelist Found NULL in summon_pet_monster()\n");
return 0;
}
! number = prevtr->nrof;
if (!dir)
! dir = find_free_spot(prevtr->item, op->map, op->x, op->y, 1, SIZEOFFREE);
! if ((dir==-1) || arch_blocked(prevtr->item, op->map,
op->x + freearr_x[dir], op->y+freearr_y[dir])) {
new_draw_info(NDI_UNIQUE, 0, op, "There is something in the way.");
return 0;
--- 1773,1792 ----
if (trlist == NULL)
return 0;
! for (i=0, tr=trlist->items; tr != NULL && i < level &&
! tr->next != NULL && tr->next->item != NULL; tr = tr->next, i++);
! if(tr == NULL || tr->item == NULL) {
LOG(llevError,"Treasurelist Found NULL in summon_pet_monster()\n");
return 0;
}
! number = tr->nrof;
if (!dir)
! dir = find_free_spot(tr->item, op->map, op->x, op->y, 1, SIZEOFFREE);
! if ((dir==-1) || arch_blocked(tr->item, op->map,
op->x + freearr_x[dir], op->y+freearr_y[dir])) {
new_draw_info(NDI_UNIQUE, 0, op, "There is something in the way.");
return 0;
***************
*** 1795,1806 ****
archetype *atmp;
object *prev = NULL, *head = NULL; /* We want to summon dragons *grin* */
! for(atmp = prevtr->item; atmp!=NULL; atmp = atmp->more) {
object *tmp;
tmp = arch_to_object(atmp);
/* if this is the head, set owner/friendly as needed */
! if (atmp == prevtr->item) {
set_owner(tmp, op);
SET_FLAG(tmp, FLAG_MONSTER);
if (op->type == PLAYER) {
--- 1795,1806 ----
archetype *atmp;
object *prev = NULL, *head = NULL; /* We want to summon dragons *grin* */
! for(atmp = tr->item; atmp!=NULL; atmp = atmp->more) {
object *tmp;
tmp = arch_to_object(atmp);
/* if this is the head, set owner/friendly as needed */
! if (atmp == tr->item) {
set_owner(tmp, op);
SET_FLAG(tmp, FLAG_MONSTER);
if (op->type == PLAYER) {
***************
*** 1844,1850 ****
SET_FLAG(tmp, FLAG_NO_DROP);
}
dir = absdir(dir + 1);
! if (arch_blocked(prevtr->item, op->map, op->x + freearr_x[dir], op->y + freearr_y[dir])) {
if (i < number) {
new_draw_info(NDI_UNIQUE, 0,op, "There is something in the way,");
new_draw_info(NDI_UNIQUE, 0,op, "no more pets for this casting.");
--- 1844,1850 ----
SET_FLAG(tmp, FLAG_NO_DROP);
}
dir = absdir(dir + 1);
! if (arch_blocked(tr->item, op->map, op->x + freearr_x[dir], op->y + freearr_y[dir])) {
if (i < number) {
new_draw_info(NDI_UNIQUE, 0,op, "There is something in the way,");
new_draw_info(NDI_UNIQUE, 0,op, "no more pets for this casting.");
|