From 8c4d0f62df88fcb954530c22647610f308defc2c Mon Sep 17 00:00:00 2001 From: zicodxx <> Date: Tue, 13 Jan 2009 01:19:19 +0000 Subject: [PATCH] Adjusted D1 Lifter collision damage according to D2 to scale with FPS as Melee combats can happen in every frame; Actually set velocity from movement when colliding with objects --- CHANGELOG.txt | 5 +++++ main/physics.c | 5 +++-- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.txt b/CHANGELOG.txt index f872cd9f7..e7044a0aa 100644 --- a/CHANGELOG.txt +++ b/CHANGELOG.txt @@ -1,8 +1,13 @@ D2X-Rebirth Changelog +20090113 +-------- +main/physics.c: Actually set velocity from movement when colliding with objects + 20090108 -------- main/network.c: Fixed condition for protocol version checking when joining a game - must be allowed for both original and D2X version + 20081230 -------- SConstruct: prefix is now an argument (useful for auto-builds) diff --git a/main/physics.c b/main/physics.c index 99ccae53a..045dc07b7 100644 --- a/main/physics.c +++ b/main/physics.c @@ -745,7 +745,8 @@ 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_BAD_P0))) { + if (!obj_stopped && !bounced && ((fate == HIT_WALL) || (fate == HIT_OBJECT) || (fate == HIT_BAD_P0))) + { 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)); @@ -756,7 +757,7 @@ void do_physics_sim(object *obj) and "bump" back by the value saying how far we are in already. */ 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==ConsoleObject && fate == HIT_WALL && (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)) { vms_vector center,bump_vec;