Fixing collision bugs; Cleaning hudmsg.h; Solving death sequence timer without GameTime and removed another global

This commit is contained in:
zicodxx 2008-04-13 13:14:19 +00:00
parent d3aca2140d
commit 3192ab5b54
5 changed files with 26 additions and 32 deletions

View file

@ -4,6 +4,7 @@ D1X-Rebirth Changelog
--------
include/args.h, main/newmenu.c, main/collide.h, main/network.c, main/multi.c, main/multi.h, main/inferno.c, main/menu.c, main/menu.h, main/playsave.c, main/playsave.h, main/object.c, main/hud.c, main/weapon.c, main/hostage.c, main/newdemo.c, main/config.c, main/gameseq.c, main/endlevel.c, main/ai.h, main/game.c, main/gauges.c, main/game.h, main/kconfig.c, main/kconfig.h, misc/args.c, d1x.ini, arch/ogl/ogl.c, arch/ogl/gr.c, arch/sdl/joy.c, arch/include/joy.h: Added structure for values saved in PLR/PLX files; Added most common command-line options to options menu
main/laser.c, main/menu.c, main/playsave.c: Reverted homers turn_radius again to respect higher difficulty levels; Added PRShot to menus; Fixed typo in OglAlphaEffects saving
main/collide.c, main/hudmsg.h, main/object.c, main/physics.c: Fixing collision bugs; Cleaning hudmsg.h; Solving death sequence timer without GameTime and removed another global
20080408
--------

View file

@ -625,16 +625,15 @@ void collide_robot_and_robot( object * robot1, object * robot2, vms_vector *coll
void collide_robot_and_controlcen( object * obj1, object * obj2, vms_vector *collision_point )
{
// if (obj1->type == OBJ_ROBOT) {
// vms_vector hitvec;
// vm_vec_normalize_quick(vm_vec_sub(&hitvec, &obj2->pos, &obj1->pos));
// bump_one_object(obj1, &hitvec, 0);
// } else {
// vms_vector hitvec;
// vm_vec_normalize_quick(vm_vec_sub(&hitvec, &obj1->pos, &obj2->pos));
// bump_one_object(obj2, &hitvec, 0);
// }
bump_two_objects(obj1, obj2, 0);
if (obj1->type == OBJ_ROBOT) {
vms_vector hitvec;
vm_vec_normalize_quick(vm_vec_sub(&hitvec, &obj2->pos, &obj1->pos));
bump_one_object(obj1, &hitvec, 0);
} else {
vms_vector hitvec;
vm_vec_normalize_quick(vm_vec_sub(&hitvec, &obj1->pos, &obj2->pos));
bump_one_object(obj2, &hitvec, 0);
}
}
//##void collide_robot_and_hostage( object * robot, object * hostage, vms_vector *collision_point ) {

View file

@ -21,19 +21,11 @@
#define MSGC_PLAYERMESSAGES (~(MSGC_PICKUP_TOOMUCH | MSGC_PICKUP_ALREADY | MSGC_PICKUP_OK))
#define HUD_MESSAGE_LENGTH 150
#define HUD_MAX_NUM 80 //max to display in scrollback mode (and as such, the max to store, period)
extern int HUD_max_num_disp;
#define HUD_MAX_NUM 4
extern int MSG_Playermessages;
extern int MSG_Noredundancy;
//killed 11/01/98 -MM
//added on 10/04/98 by Matt Mueller to allow hud message logging
//extern int HUD_log_messages;
//end addition -MM
//end kill -MM
#ifdef __GNUC__
extern void hud_message(int class, char *format, ...)
__attribute__ ((format (printf, 2, 3)));

View file

@ -1186,7 +1186,6 @@ void obj_delete(int objnum)
int Player_is_dead = 0; // If !0, then player is dead, but game continues so he can watch.
object *Dead_player_camera = NULL; // Object index of object watching deader.
fix Player_time_of_death; // Time at which player died.
object *Viewer_save;
int Player_flags_save;
int Player_exploded = 0;
@ -1282,20 +1281,19 @@ extern int get_explosion_vclip(object *obj,int stage);
// ------------------------------------------------------------------------------------------------------------------
void dead_player_frame(void)
{
fix time_dead;
static fix time_dead = 0;
vms_vector fvec;
if (Player_is_dead)
{
time_dead = GameTime - Player_time_of_death;
{
time_dead += FrameTime;
// If unable to create camera at time of death, create now.
if (Dead_player_camera == Viewer_save) {
int objnum;
object *player = &Objects[Players[Player_num].objnum];
//this next line was changed by WraithX, instead of CT_FLYING, it was CT_NONE: instead of MT_PHYSICS, it was MT_NONE.
objnum = obj_create(OBJ_CAMERA, 0, player->segnum, &player->pos, &player->orient, 0, CT_FLYING, MT_PHYSICS, RT_NONE);
objnum = obj_create(OBJ_CAMERA, 0, player->segnum, &player->pos, &player->orient, 0, CT_NONE, MT_NONE, RT_NONE);
if (objnum != -1)
Viewer = Dead_player_camera = &Objects[objnum];
@ -1390,6 +1388,8 @@ void dead_player_frame(void)
DoPlayerDead(); //kill_player();
}
}
else
time_dead = 0;
}
int Killed_in_frame = -1;
@ -1430,9 +1430,7 @@ void start_player_death_sequence(object *player)
vm_vec_zero(&player->mtype.phys_info.rotthrust); //this line commented by WraithX
vm_vec_zero(&player->mtype.phys_info.thrust);
Player_time_of_death = GameTime;
//this next line was changed by WraithX, instead of CT_FLYING, it was CT_NONE: instead of MT_PHYSICS, it was MT_NONE.
objnum = obj_create(OBJ_CAMERA, 0, player->segnum, &player->pos, &player->orient, 0, CT_FLYING, MT_PHYSICS, RT_NONE);
objnum = obj_create(OBJ_CAMERA, 0, player->segnum, &player->pos, &player->orient, 0, CT_NONE, MT_NONE, RT_NONE);
Viewer_save = Viewer;
if (objnum != -1)
Viewer = Dead_player_camera = &Objects[objnum];
@ -1452,7 +1450,7 @@ void start_player_death_sequence(object *player)
player->flags &= ~OF_SHOULD_BE_DEAD;
// Players[Player_num].flags |= PLAYER_FLAGS_INVULNERABLE;
player->control_type = CT_FLYING; //change from CT_NONE to CT_FLYING by WraithX
player->control_type = CT_NONE;
player->shields = F1_0*1000;
PALETTE_FLASH_SET(0,0,0);

View file

@ -676,20 +676,24 @@ void do_physics_sim(object *obj)
}
if (! obj_stopped) { //Set velocity from actual movement
static fix last_bump=0;
vms_vector moved_vec;
vm_vec_sub(&moved_vec,&obj->pos,&start_pos);
vm_vec_copy_scale(&obj->mtype.phys_info.velocity,&moved_vec,fixdiv(f1_0,FrameTime));
#ifdef BUMP_HACK
if (obj==ConsoleObject && (obj->mtype.phys_info.velocity.x==0 && obj->mtype.phys_info.velocity.y==0 && obj->mtype.phys_info.velocity.z==0) &&
!(obj->mtype.phys_info.thrust.x==0 && obj->mtype.phys_info.thrust.y==0 && obj->mtype.phys_info.thrust.z==0) && fate == HIT_WALL) {
if (
obj==ConsoleObject && (obj->mtype.phys_info.velocity.x==0 && obj->mtype.phys_info.velocity.y==0 && obj->mtype.phys_info.velocity.z==0) &&
!(obj->mtype.phys_info.thrust.x==0 && obj->mtype.phys_info.thrust.y==0 && obj->mtype.phys_info.thrust.z==0)
&& (GameTime > last_bump+(F1_0/33) || GameTime < last_bump) )
{
vms_vector center,bump_vec;
//bump player a little towards center of segment to unstick
compute_segment_center(&center,&Segments[obj->segnum]);
vm_vec_normalized_dir_quick(&bump_vec,&center,&obj->pos);
vm_vec_scale_add2(&obj->pos,&bump_vec,obj->size/5);
last_bump=GameTime;
}
#endif
}