From 6d018dc5fca3007851c56b1ccefd0f07676eb9cb Mon Sep 17 00:00:00 2001 From: zicodxx <> Date: Sun, 22 Feb 2009 10:53:10 +0000 Subject: [PATCH] Fixed param handling of expl_obj in do_explosion_sequence for the case that free_object_slots might have it set to OF_SHOULD_BE_DEAD before it's actually attached to another object --- CHANGELOG.txt | 4 ++++ main/fireball.c | 5 +++-- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.txt b/CHANGELOG.txt index 0a6ca304e..e25266191 100644 --- a/CHANGELOG.txt +++ b/CHANGELOG.txt @@ -1,5 +1,9 @@ D2X-Rebirth Changelog +20090222 +-------- +main/fireball.c: Fixed param handling of expl_obj in do_explosion_sequence for the case that free_object_slots might have it set to OF_SHOULD_BE_DEAD before it's actually attached to another object + 20090217 -------- main/object.c, main/object.h, main/weapon.c: Made Max_used_objects an absolute defined value; Made num_objects globally available; Restricted Weapon drops to MAX_USED_OBJECTS; When dropping Secondary weapon, drop 4-pack if possible diff --git a/main/fireball.c b/main/fireball.c index 9bf23497c..1087ef6ae 100644 --- a/main/fireball.c +++ b/main/fireball.c @@ -1221,8 +1221,9 @@ void do_explosion_sequence(object *obj) explode_model(del_obj); //explode a polygon model //set some parm in explosion - if (expl_obj) { - + //If num_objects < MAX_USED_OBJECTS, expl_obj could be set to dead before this setting causing the delete_obj not to be removed. If so, directly delete del_obj + if (expl_obj && !(expl_obj->flags & OF_SHOULD_BE_DEAD)) + { if (del_obj->movement_type == MT_PHYSICS) { expl_obj->movement_type = MT_PHYSICS; expl_obj->mtype.phys_info = del_obj->mtype.phys_info;