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

This commit is contained in:
zicodxx 2009-02-17 11:34:16 +00:00
parent 5618f08d2d
commit d7a8f5ad84
3 changed files with 8 additions and 212 deletions

View file

@ -1,5 +1,9 @@
D1X-Rebirth Changelog
20090217
--------
main/object.c, main/object.h: Made Max_used_objects an absolute defined value; Made num_objects globally available
20090215
--------
main/network.c, main/noloss.c, main/noloss.h: Added list to keep trace of received PDATA packets so receiver won't interpret them several times

View file

@ -1639,8 +1639,6 @@ void object_move_one( object * obj )
#endif
}
int Max_used_objects = MAX_OBJECTS - 20;
//--------------------------------------------------------------------
//move all objects for the current frame
void object_move_all()
@ -1651,8 +1649,8 @@ void object_move_all()
// check_duplicate_objects();
// remove_incorrect_objects();
if (Highest_object_index > Max_used_objects)
free_object_slots(Max_used_objects); // Free all possible object slots.
if (Highest_object_index > MAX_USED_OBJECTS)
free_object_slots(MAX_USED_OBJECTS); // Free all possible object slots.
obj_delete_all_that_should_be_dead();

View file

@ -11,217 +11,9 @@ AND AGREES TO THE TERMS HEREIN AND ACCEPTS THE SAME BY USE OF THIS FILE.
COPYRIGHT 1993-1998 PARALLAX SOFTWARE CORPORATION. ALL RIGHTS RESERVED.
*/
/*
* $Source: /cvsroot/dxx-rebirth/d1x-rebirth/main/object.h,v $
* $Revision: 1.1.1.1 $
* $Author: zicodxx $
* $Date: 2006/03/17 19:43:59 $
*
* object system definitions
*
* $Log: object.h,v $
* Revision 1.1.1.1 2006/03/17 19:43:59 zicodxx
* initial import
*
* Revision 1.1.1.1 1999/06/14 22:12:58 donut
* Import of d1x 1.37 source.
*
* Revision 2.1 1995/03/31 12:24:10 john
* I had changed alt_textures from a pointer to a byte. This hosed old
* saved games, so I restored it to an int.
*
* Revision 2.0 1995/02/27 11:26:47 john
* New version 2.0, which has no anonymous unions, builds with
* Watcom 10.0, and doesn't require parsing BITMAPS.TBL.
*
* Revision 1.122 1995/02/22 12:35:53 allender
* remove anonymous unions
*
* Revision 1.121 1995/02/06 20:43:25 rob
* Extern'ed Dead_player_camera so it can be reset by multi.c
*
* Revision 1.120 1995/02/01 16:34:07 john
* Linted.
*
* Revision 1.119 1995/01/29 13:46:42 mike
* adapt to new create_small_fireball_on_object prototype.
*
* Revision 1.118 1995/01/26 22:11:27 mike
* Purple chromo-blaster (ie, fusion cannon) spruce up (chromification)
*
* Revision 1.117 1995/01/24 12:09:29 mike
* Boost MAX_OBJECTS from 250 to 350.
*
* Revision 1.116 1995/01/13 19:39:51 rob
* Removed outdated remote_info structure. (looking for cause of bugs
*
* Revision 1.115 1995/01/12 12:09:38 yuan
* Added coop object capability.
*
* Revision 1.114 1994/12/15 13:04:20 mike
* Replace Players[Player_num].time_total references with GameTime.
*
* Revision 1.113 1994/12/12 17:18:09 mike
* make boss cloak/teleport when get hit, make quad laser 3/4 as powerful.
*
* Revision 1.112 1994/12/09 14:58:42 matt
* Added system to attach a fireball to another object for rendering purposes,
* so the fireball always renders on top of (after) the object.
*
* Revision 1.111 1994/12/08 12:35:35 matt
* Added new object allocation & deallocation functions so other code
* could stop messing around with internal object data structures.
*
* Revision 1.110 1994/11/21 17:30:21 matt
* Increased max number of objects
*
* Revision 1.109 1994/11/18 23:41:52 john
* Changed some shorts to ints.
*
* Revision 1.108 1994/11/10 14:02:45 matt
* Hacked in support for player ships with different textures
*
* Revision 1.107 1994/11/08 12:19:27 mike
* Small explosions on objects.
*
* Revision 1.106 1994/10/25 10:51:17 matt
* Vulcan cannon powerups now contain ammo count
*
* Revision 1.105 1994/10/21 12:19:41 matt
* Clear transient objects when saving (& loading) games
*
* Revision 1.104 1994/10/21 11:25:04 mike
* Add IMMORTAL_TIME.
*
* Revision 1.103 1994/10/17 21:34:54 matt
* Added support for new Control Center/Main Reactor
*
* Revision 1.102 1994/10/14 18:12:28 mike
* Make egg dropping return object number.
*
* Revision 1.101 1994/10/12 21:07:19 matt
* Killed unused field in object structure
*
* Revision 1.100 1994/10/12 10:38:24 mike
* Add field OF_SILENT to obj->flags.
*
* Revision 1.99 1994/10/11 20:35:48 matt
* Clear "transient" objects (weapons,explosions,etc.) when starting a level
*
* Revision 1.98 1994/10/03 20:56:13 rob
* Added velocity to shortpos strucutre.
*
* Revision 1.97 1994/09/30 18:24:00 rob
* Added new control type CT_REMOTE for remote controlled objects.
* Also added a union struct 'remote_info' for this type.
*
* Revision 1.96 1994/09/28 09:23:05 mike
* Prototype Object_type_names.
*
* Revision 1.95 1994/09/25 23:32:37 matt
* Changed the object load & save code to read/write the structure fields one
* at a time (rather than the whole structure at once). This mean that the
* object structure can be changed without breaking the load/save functions.
* As a result of this change, the local_object data can be and has been
* incorporated into the object array. Also, timeleft is now a property
* of all objects, and the object structure has been otherwise cleaned up.
*
* Revision 1.94 1994/09/25 15:45:28 matt
* Added OBJ_LIGHT, a type of object that casts light
* Added generalized lifeleft, and moved it to local_object
*
* Revision 1.93 1994/09/24 17:41:19 mike
* Add stuff to Local_object structure for materialization centers.
*
* Revision 1.92 1994/09/24 13:16:50 matt
* Added (hacked in, really) support for overriding the bitmaps used on to
* texture map a polygon object, and using a new bitmap for all the faces.
*
* Revision 1.91 1994/09/22 19:02:14 mike
* Prototype functions extract_shortpos and create_shortpos which reside in
* gameseg.c, but are prototyped here to prevent circular dependencies.
*
* Revision 1.90 1994/09/15 21:47:14 mike
* Prototype dead_player_end().
*
* Revision 1.89 1994/09/15 16:34:47 mike
* Add danger_laser_num and danger_laser_signature to object_local to
* enable robots to efficiently (too efficiently!) avoid player fire.
*
* Revision 1.88 1994/09/11 22:46:19 mike
* Death_sequence_aborted prototyped.
*
* Revision 1.87 1994/09/09 20:04:30 mike
* Add vclips for weapons.
*
* Revision 1.86 1994/09/09 14:20:54 matt
* Added flag that says object uses thrust
*
* Revision 1.85 1994/09/08 14:51:32 mike
* Make a crucial name change to a field of local_object struct.
*
* Revision 1.84 1994/09/07 19:16:45 mike
* Homing missile.
*
* Revision 1.83 1994/09/06 17:05:43 matt
* Added new type for dead player
*
* Revision 1.82 1994/09/02 11:56:09 mike
* Add persistency (PF_PERSISTENT) to physics_info.
*
* Revision 1.81 1994/08/28 19:10:28 mike
* Add Player_is_dead.
*
* Revision 1.80 1994/08/18 15:11:44 mike
* powerup stuff.
*
* Revision 1.79 1994/08/15 15:24:54 john
* Made players know who killed them; Disabled cheat menu
* during net player; fixed bug with not being able to turn
* of invulnerability; Made going into edit/starting new leve
* l drop you out of a net game; made death dialog box.
*
* Revision 1.78 1994/08/14 23:15:12 matt
* Added animating bitmap hostages, and cleaned up vclips a bit
*
* Revision 1.77 1994/08/13 14:58:27 matt
* Finished adding support for miscellaneous objects
*
* Revision 1.76 1994/08/09 16:04:13 john
* Added network players to editor.
*
* Revision 1.75 1994/08/03 21:06:19 matt
* Added prototype for fix_object_segs(), and renamed now-unused spawn_pos
*
* Revision 1.74 1994/08/02 12:30:27 matt
* Added support for spinning objects
*
* Revision 1.73 1994/07/27 20:53:25 matt
* Added rotational drag & thrust, so turning now has momemtum like moving
*
* Revision 1.72 1994/07/27 19:44:21 mike
* Objects containing objects.
*
* Revision 1.71 1994/07/22 20:43:29 matt
* Fixed flares, by adding a physics flag that makes them stick to walls.
*
* Revision 1.70 1994/07/21 12:42:10 mike
* Prototype new find_object_seg and update_object_seg.
*
* Revision 1.69 1994/07/19 15:26:39 mike
* New ai_static structure.
*
* Revision 1.68 1994/07/13 00:15:06 matt
* Moved all (or nearly all) of the values that affect player movement to
* bitmaps.tbl
*
* Revision 1.67 1994/07/12 12:40:12 matt
* Revamped physics system
*
* Revision 1.66 1994/07/06 15:26:23 yuan
* Added chase mode.
*
*
*
*/
#ifndef _OBJECT_H
@ -240,6 +32,7 @@ COPYRIGHT 1993-1998 PARALLAX SOFTWARE CORPORATION. ALL RIGHTS RESERVED.
*/
#define MAX_OBJECTS 350 //increased on 01/24/95 for multiplayer. --MK; total number of objects in world
#define MAX_USED_OBJECTS (MAX_OBJECTS-20)
//Object types
#define OBJ_NONE 255 //unused object
@ -484,6 +277,7 @@ extern ubyte CollisionResult[MAX_OBJECT_TYPES][MAX_OBJECT_TYPES];
extern object Objects[];
extern int Highest_object_index; //highest objnum
extern int num_objects;
extern char *robot_names[]; //name of each robot