Code consistency checks by _Tyr_; Fixed set but unused variables

This commit is contained in:
zicodxx 2011-09-26 18:58:06 +02:00
parent 80e69421d8
commit 22316fa5d6
2 changed files with 13 additions and 10 deletions

View file

@ -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

View file

@ -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; count<objp->contains_count; count++) {