Test
This commit is contained in:
@@ -290,8 +290,7 @@ attack(struct rogue_state *rs,THING *mp)
|
|||||||
}
|
}
|
||||||
when 'N':
|
when 'N':
|
||||||
{
|
{
|
||||||
register THING *obj, *steal;
|
THING *obj, *steal; int nobj;
|
||||||
register int nobj;
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Nymph's steal a magic item, look through the pack
|
* Nymph's steal a magic item, look through the pack
|
||||||
@@ -594,26 +593,25 @@ void
|
|||||||
remove_mon(struct rogue_state *rs,coord *mp, THING *tp, bool waskill)
|
remove_mon(struct rogue_state *rs,coord *mp, THING *tp, bool waskill)
|
||||||
{
|
{
|
||||||
register THING *obj, *nexti;
|
register THING *obj, *nexti;
|
||||||
|
|
||||||
for (obj = tp->t_pack; obj != NULL; obj = nexti)
|
for (obj = tp->t_pack; obj != NULL; obj = nexti)
|
||||||
{
|
{
|
||||||
nexti = next(obj);
|
nexti = next(obj);
|
||||||
obj->o_pos = tp->t_pos;
|
obj->o_pos = tp->t_pos;
|
||||||
detach(tp->t_pack, obj);
|
detach(tp->t_pack, obj);
|
||||||
if (waskill)
|
if (waskill)
|
||||||
fall(rs,obj, FALSE);
|
fall(rs,obj, FALSE);
|
||||||
else
|
else
|
||||||
discard(obj);
|
discard(obj);
|
||||||
}
|
}
|
||||||
moat(mp->y, mp->x) = NULL;
|
moat(mp->y, mp->x) = NULL;
|
||||||
mvaddch(mp->y, mp->x, tp->t_oldch);
|
mvaddch(mp->y, mp->x, tp->t_oldch);
|
||||||
detach(mlist, tp);
|
detach(mlist, tp);
|
||||||
if (on(*tp, ISTARGET))
|
if (on(*tp, ISTARGET))
|
||||||
{
|
{
|
||||||
kamikaze = FALSE;
|
kamikaze = FALSE;
|
||||||
to_death = FALSE;
|
to_death = FALSE;
|
||||||
if (fight_flush)
|
if (fight_flush)
|
||||||
flush_type();
|
flush_type();
|
||||||
}
|
}
|
||||||
discard(tp);
|
discard(tp);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -61,6 +61,16 @@ discard(THING *item)
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
THING *list = pack;
|
||||||
|
for (; list != NULL; list = next(list))
|
||||||
|
{
|
||||||
|
if ( list == item )
|
||||||
|
{
|
||||||
|
fprintf(stderr,"pack item discarded? (%s)\n",inv_name(list,FALSE));
|
||||||
|
sleep(3);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
#endif
|
#endif
|
||||||
itemcounter--;
|
itemcounter--;
|
||||||
free((char *) item);
|
free((char *) item);
|
||||||
@@ -89,11 +99,11 @@ void
|
|||||||
_detach(THING **list, THING *item)
|
_detach(THING **list, THING *item)
|
||||||
{
|
{
|
||||||
if (*list == item)
|
if (*list == item)
|
||||||
*list = next(item);
|
*list = next(item);
|
||||||
if (prev(item) != NULL)
|
if (prev(item) != NULL)
|
||||||
item->l_prev->l_next = next(item);
|
item->l_prev->l_next = next(item);
|
||||||
if (next(item) != NULL)
|
if (next(item) != NULL)
|
||||||
item->l_next->l_prev = prev(item);
|
item->l_next->l_prev = prev(item);
|
||||||
item->l_next = NULL;
|
item->l_next = NULL;
|
||||||
item->l_prev = NULL;
|
item->l_prev = NULL;
|
||||||
}
|
}
|
||||||
@@ -108,14 +118,14 @@ _attach(THING **list, THING *item)
|
|||||||
{
|
{
|
||||||
if (*list != NULL)
|
if (*list != NULL)
|
||||||
{
|
{
|
||||||
item->l_next = *list;
|
item->l_next = *list;
|
||||||
(*list)->l_prev = item;
|
(*list)->l_prev = item;
|
||||||
item->l_prev = NULL;
|
item->l_prev = NULL;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
item->l_next = NULL;
|
item->l_next = NULL;
|
||||||
item->l_prev = NULL;
|
item->l_prev = NULL;
|
||||||
}
|
}
|
||||||
*list = item;
|
*list = item;
|
||||||
}
|
}
|
||||||
@@ -129,17 +139,14 @@ void
|
|||||||
_free_list(THING **ptr)
|
_free_list(THING **ptr)
|
||||||
{
|
{
|
||||||
THING *item;
|
THING *item;
|
||||||
|
|
||||||
while (*ptr != NULL)
|
while (*ptr != NULL)
|
||||||
{
|
{
|
||||||
item = *ptr;
|
item = *ptr;
|
||||||
*ptr = next(item);
|
*ptr = next(item);
|
||||||
discard(item);
|
discard(item);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* new_item
|
* new_item
|
||||||
* Get a new item with a specified size
|
* Get a new item with a specified size
|
||||||
|
|||||||
Reference in New Issue
Block a user