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

This commit is contained in:
zicodxx 2010-02-05 18:49:24 +00:00
parent fa7ab97783
commit 134f6dc388
2 changed files with 5 additions and 1 deletions

View file

@ -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
--------

View file

@ -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);