fixed smart missiles and smart mines w/shareware data

This commit is contained in:
Bradley Bell 2003-10-10 00:24:38 +00:00
parent a049d1d6c8
commit 72429f2658
3 changed files with 31 additions and 11 deletions

View file

@ -1,5 +1,8 @@
2003-10-09 Bradley Bell <btb@icculus.org>
* main/laser.c, main/weapon.c: fixed smart missiles and smart
mines w/shareware data
* include/DT_drawtext.h: deleted unused file
2003-10-08 Bradley Bell <btb@icculus.org>

View file

@ -1,4 +1,4 @@
/* $Id: laser.c,v 1.8 2003-10-04 03:14:47 btb Exp $ */
/* $Id: laser.c,v 1.9 2003-10-10 00:24:38 btb Exp $ */
/*
THE COMPUTER CODE CONTAINED HEREIN IS THE SOLE PROPERTY OF PARALLAX
SOFTWARE CORPORATION ("PARALLAX"). PARALLAX, IN DISTRIBUTING THE CODE TO
@ -28,7 +28,7 @@ COPYRIGHT 1993-1999 PARALLAX SOFTWARE CORPORATION. ALL RIGHTS RESERVED.
#endif
#ifdef RCS
char laser_rcsid[] = "$Id: laser.c,v 1.8 2003-10-04 03:14:47 btb Exp $";
char laser_rcsid[] = "$Id: laser.c,v 1.9 2003-10-10 00:24:38 btb Exp $";
#endif
#include <stdlib.h>
@ -2058,12 +2058,10 @@ extern void blast_nearby_glass(object *objp, fix damage);
void create_smart_children(object *objp, int num_smart_children)
{
int parent_type, parent_num;
#ifndef SHAREWARE
int make_sound;
int numobjs=0;
int objlist[MAX_OBJDISTS];
int blob_id;
#endif
if (objp->type == OBJ_WEAPON) {
parent_type = objp->ctype.laser_info.parent_type;
@ -2080,13 +2078,10 @@ void create_smart_children(object *objp, int num_smart_children)
if (objp->id == EARTHSHAKER_ID)
blast_nearby_glass(objp, Weapon_info[EARTHSHAKER_ID].strength[Difficulty_level]);
#ifndef SHAREWARE
#if 0
// -- DEBUG --
if ((objp->type == OBJ_WEAPON) && ((objp->id == SMART_ID) || (objp->id == SUPERPROX_ID) || (objp->id == ROBOT_SUPERPROX_ID) || (objp->id == EARTHSHAKER_ID)))
Assert(Weapon_info[objp->id].children != -1);
// -- DEBUG --
#endif
if (((objp->type == OBJ_WEAPON) && (Weapon_info[objp->id].children != -1)) || (objp->type == OBJ_ROBOT)) {
int i, objnum;
@ -2193,7 +2188,6 @@ void create_smart_children(object *objp, int num_smart_children)
make_sound = 0;
}
}
#endif
}
int Missile_gun = 0;

View file

@ -1,4 +1,4 @@
/* $Id: weapon.c,v 1.7 2003-10-04 03:14:48 btb Exp $ */
/* $Id: weapon.c,v 1.8 2003-10-10 00:24:38 btb Exp $ */
/*
THE COMPUTER CODE CONTAINED HEREIN IS THE SOLE PROPERTY OF PARALLAX
SOFTWARE CORPORATION ("PARALLAX"). PARALLAX, IN DISTRIBUTING THE CODE TO
@ -200,7 +200,7 @@ COPYRIGHT 1993-1999 PARALLAX SOFTWARE CORPORATION. ALL RIGHTS RESERVED.
#endif
#ifdef RCS
static char rcsid[] = "$Id: weapon.c,v 1.7 2003-10-04 03:14:48 btb Exp $";
static char rcsid[] = "$Id: weapon.c,v 1.8 2003-10-10 00:24:38 btb Exp $";
#endif
#include <stdlib.h>
@ -1522,7 +1522,30 @@ extern int weapon_info_read_n(weapon_info *wi, int n, CFILE *fp, int file_versio
if (file_version >= 3)
wi[i].children = cfile_read_byte(fp);
else
wi[i].children = -1;
/* Set the type of children correctly when using old
* datafiles. In earlier descent versions this was simply
* hard-coded in create_smart_children().
*/
switch (i)
{
case SMART_ID:
wi[i].children = PLAYER_SMART_HOMING_ID;
break;
case SUPERPROX_ID:
wi[i].children = SMART_MINE_HOMING_ID;
break;
#if 0 /* not present in shareware */
case ROBOT_SUPERPROX_ID:
wi[i].children = ROBOT_SMART_MINE_HOMING_ID;
break;
case EARTHSHAKER_ID:
wi[i].children = EARTHSHAKER_MEGA_ID;
break;
#endif
default:
wi[i].children = -1;
break;
}
wi[i].energy_usage = cfile_read_fix(fp);
wi[i].fire_wait = cfile_read_fix(fp);