Crossfire Mailing List Archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Bug Warning




 I believe I finally found a chief cause of the elusive 'removing a removed
object' bug.

 The cause is this:  Many functions call insert_ob_in_map and assume
that the object they requested for insertion is still valid.

 However, once in a while, this is not true.  insert_ob_in_map calls
check_walk_on.  In infrequent cases, the object being inserted is
then applied, and used up (firebullet is a prime example).  The calling
function then tries to do more actions with that object, not releasing
it is no longer valid.

 The solution is check to see if the object is still valid if you need
it to be (many functions insert the object never to care about it
again).  The way to do this is QUERY_FLAG(op, FLAG_FREED).  I did this
for the fire_arch function (which firebullet uses).

 The purpose of the message is to bring some awareness to the problem
when writing new code.

 --Mark