From 134f6dc38873d568f0b8832059bc162d8bc9b4c7 Mon Sep 17 00:00:00 2001 From: zicodxx <> Date: Fri, 5 Feb 2010 18:49:24 +0000 Subject: [PATCH] In do_physics_sim() only set velocity from movement for certain objects which actually do collisions like Player or Robots - otherwise we might be able to shoot down projectiles or produce other unfortunate glitches --- CHANGELOG.txt | 1 + main/physics.c | 5 ++++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.txt b/CHANGELOG.txt index c3ee5245d..da89eb5f4 100644 --- a/CHANGELOG.txt +++ b/CHANGELOG.txt @@ -5,6 +5,7 @@ D1X-Rebirth Changelog main/game.c, main/gameseq.c, main/newdemo.c: Use palette_save and palette_restore for all windows displayed over Game_wind, not just for do_option main/gameseq.c, main/newmenu.c: No showing the main menu background between loading a level and playing it (syncing with D2X) main/window.c: Send EVENT_WINDOW_DEACTIVATE before EVENT_WINDOW_ACTIVATE, ensuring cursor remains shown when appropriate +main/physics.c: In do_physics_sim() only set velocity from movement for certain objects which actually do collisions like Player or Robots - otherwise we might be able to shoot down projectiles or produce other unfortunate glitches 20100202 -------- diff --git a/main/physics.c b/main/physics.c index 17dbebf4c..751f581b2 100644 --- a/main/physics.c +++ b/main/physics.c @@ -697,7 +697,10 @@ void do_physics_sim(object *obj) } // After collision with objects and walls, set velocity from actual movement - if (!obj_stopped && ((fate == HIT_WALL) || (fate == HIT_OBJECT) || (fate == HIT_BAD_P0))) + if (!obj_stopped + && ((obj->type == OBJ_PLAYER) || (obj->type == OBJ_ROBOT) || (obj->type == OBJ_DEBRIS)) + && ((fate == HIT_WALL) || (fate == HIT_OBJECT) || (fate == HIT_BAD_P0)) + ) { vms_vector moved_vec; vm_vec_sub(&moved_vec,&obj->pos,&start_pos);