diff --git a/CHANGELOG.txt b/CHANGELOG.txt index 86e305e49..b21591137 100644 --- a/CHANGELOG.txt +++ b/CHANGELOG.txt @@ -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 -------- diff --git a/main/collide.c b/main/collide.c index 202596d58..871407bbb 100644 --- a/main/collide.c +++ b/main/collide.c @@ -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 ) { diff --git a/main/hudmsg.h b/main/hudmsg.h index de8a27bbe..3eaebbb15 100644 --- a/main/hudmsg.h +++ b/main/hudmsg.h @@ -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))); diff --git a/main/object.c b/main/object.c index 08468ffa5..6ea1ced84 100644 --- a/main/object.c +++ b/main/object.c @@ -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); diff --git a/main/physics.c b/main/physics.c index 0fcc99cb6..15562bd34 100644 --- a/main/physics.c +++ b/main/physics.c @@ -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(¢er,&Segments[obj->segnum]); vm_vec_normalized_dir_quick(&bump_vec,¢er,&obj->pos); vm_vec_scale_add2(&obj->pos,&bump_vec,obj->size/5); + last_bump=GameTime; } #endif }