U162 - killing shopkeeper with unpaid thrown objects

While an object is being thrown, it isn't on any list.  This means that
killing a shopkeeper with an unpaid object wouldn't be able to clear the
unpaid bit.  By the time the object lands, the shopkeeper is gone, and then
it's too late.  Added a new global to track a thrown object, set it and later
clear it in throwit(), also clear it as needed in dealloc_obj(), and check
it in setpaid().  It should be possible to use this global to avoid losing
thrown objects during hangup saves as well.  But that can wait.
This commit is contained in:
cohrs
2003-02-13 07:52:49 +00:00
parent 6885f18bb1
commit d1fdc497d2
4 changed files with 26 additions and 3 deletions

View File

@@ -16,6 +16,8 @@ STATIC_DCL void FDECL(check_contained, (struct obj *,const char *));
#endif
#endif /* OVL1 */
extern struct obj *thrownobj; /* defined in dothrow.c */
/*#define DEBUG_EFFECTS*/ /* show some messages for debugging */
struct icp {
@@ -1483,6 +1485,8 @@ dealloc_obj(obj)
if (obj_sheds_light(obj))
del_light_source(LS_OBJECT, (genericptr_t) obj);
if (obj == thrownobj) thrownobj = (struct obj*)0;
free((genericptr_t) obj);
}