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 5adb2fb3fb
commit 32259f33a3
2 changed files with 5 additions and 1 deletions

View file

@ -5,6 +5,7 @@ D2X-Rebirth Changelog
main/automap.c, main/escort.c, main/game.c, main/game.h, main/gamecntl.c, main/gameseq.c, main/newdemo.c, main/newmenu.c: Put the full_palette_save and palette_restore calls in the game handler for tidiness; remove leftover redundant digi_resume_digi_sounds calls
main/newmenu.c: No showing the main menu background between loading a level and playing it, fixing palette issue when autoplaying a demo
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

@ -741,7 +741,10 @@ void do_physics_sim(object *obj)
}
// After collision with objects and walls, set velocity from actual movement
if (!obj_stopped && !bounced && ((fate == HIT_WALL) || (fate == HIT_OBJECT) || (fate == HIT_BAD_P0)))
if (!obj_stopped && !bounced
&& ((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);