Prevent pack corruption
This commit is contained in:
@@ -308,6 +308,7 @@ attack(struct rogue_state *rs,THING *mp)
|
|||||||
mp=NULL;
|
mp=NULL;
|
||||||
leave_pack(rs,steal, FALSE, FALSE);
|
leave_pack(rs,steal, FALSE, FALSE);
|
||||||
msg(rs,"she stole %s!", inv_name(steal, TRUE));
|
msg(rs,"she stole %s!", inv_name(steal, TRUE));
|
||||||
|
if ( steal->o_count <= 0 )
|
||||||
discard(steal);
|
discard(steal);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -600,8 +601,7 @@ remove_mon(struct rogue_state *rs,coord *mp, THING *tp, bool waskill)
|
|||||||
detach(tp->t_pack, obj);
|
detach(tp->t_pack, obj);
|
||||||
if (waskill)
|
if (waskill)
|
||||||
fall(rs,obj, FALSE);
|
fall(rs,obj, FALSE);
|
||||||
else if ( obj->o_count <= 0 )
|
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);
|
||||||
|
|||||||
Reference in New Issue
Block a user