diff --git a/CHANGELOG.txt b/CHANGELOG.txt index 25cb4d784..bc6a40ad4 100644 --- a/CHANGELOG.txt +++ b/CHANGELOG.txt @@ -1,5 +1,9 @@ D1X-Rebirth Changelog +20110926 +-------- +main/fireball.c: Code consistency checks by _Tyr_; Fixed set but unused variables + 20110925 -------- main/game.c: Fixed misuse of gr_bitblt_find_transparent_area() caused rear view to be shifted on some cockpits diff --git a/main/fireball.c b/main/fireball.c index f267e39e4..2e4b3d630 100644 --- a/main/fireball.c +++ b/main/fireball.c @@ -86,10 +86,16 @@ object *object_create_explosion_sub(object *objp, short segnum, vms_vector * pos // -- now legal for badass explosions on a wall. Assert(objp != NULL); for (i=0; i<=Highest_object_index; i++ ) { + sbyte parent_check = 0; // Weapons used to be affected by badass explosions, but this introduces serious problems. // When a smart bomb blows up, if one of its children goes right towards a nearby wall, it will // blow up, blowing up all the children. So I remove it. MK, 09/11/94 - if ( (obj0p->type == OBJ_CNTRLCEN) || (obj0p->type==OBJ_PLAYER) || ((obj0p->type==OBJ_ROBOT) && ((Objects[parent].type != OBJ_ROBOT) || (Objects[parent].id != obj0p->id)))) { + + if (parent != -1) + if ((Objects[parent].type != OBJ_ROBOT) || (Objects[parent].id != obj0p->id)) + parent_check = 1; + + if ( (obj0p->type == OBJ_CNTRLCEN) || (obj0p->type==OBJ_PLAYER) || ((obj0p->type==OBJ_ROBOT) && parent_check)) { dist = vm_vec_dist_quick( &obj0p->pos, &obj->pos ); // Make damage be from 'maxdamage' to 0.0, where 0.0 is 'maxdistance' away; if ( dist < maxdistance ) { @@ -229,7 +235,6 @@ object *object_create_debris(object *parent, int subobj_num) { int objnum; object *obj; - polymodel *po; Assert((parent->type == OBJ_ROBOT) || (parent->type == OBJ_PLAYER) ); @@ -257,8 +262,6 @@ object *object_create_debris(object *parent, int subobj_num) //Set physics data for this object - po = &Polygon_models[obj->rtype.pobj_info.model_num]; - obj->mtype.phys_info.velocity.x = D_RAND_MAX/2 - d_rand(); obj->mtype.phys_info.velocity.y = D_RAND_MAX/2 - d_rand(); obj->mtype.phys_info.velocity.z = D_RAND_MAX/2 - d_rand(); @@ -601,15 +604,11 @@ void maybe_replace_powerup_with_energy(object *del_obj) // Returns created object number. int object_create_egg(object *objp) { - int objnum=0; - object *obj; - int powerup_type, powerup_id, count; + int objnum=0, count; + object *obj; vms_vector new_velocity, new_pos; fix old_mag; - powerup_type = objp->contains_type; - powerup_id = objp->contains_id; - switch (objp->contains_type) { case OBJ_POWERUP: for (count=0; countcontains_count; count++) {