I was collecting all the object functions into a separate file, and I
notice update_object().
void update_object (object_t *obj, int use)
{
if (GET_OBJ_TIMER (obj) > 0)
GET_OBJ_TIMER (obj) -= use;
if (obj->contains)
update_object (obj->contains, use);
if (obj->next_content)
update_object (obj->next_content, use);
}
There is no bounds check to see if the variable 'use' would cause
GET_OBJ_TIMER(obj) to go negative, which could easily happen if 'use' > 1.
I did a quick grep and found update_object is called with 'use' == 2 if the
object is equipped.
Has anyone been hit with adverse affects from this yet? I plan to use
timers for a little bit more than just corpse clean up.
void update_object (object_t *obj, int use)
{
if (GET_OBJ_TIMER (obj) > 0)
if ((GET_OBJ_TIMER (obj) -= use) < 0)
GET_OBJ_TIMER (obj) = 0;
if (obj->contains)
update_object (obj->contains, use);
if (obj->next_content)
update_object (obj->next_content, use);
}
d.
+------------------------------------------------------------+
| Ensure that you have read the CircleMUD Mailing List FAQ: |
| http://democracy.queensu.ca/~fletcher/Circle/list-faq.html |
+------------------------------------------------------------+
This archive was generated by hypermail 2b30 : 12/08/00 PST