From 996748bdbaa3c8b41d6de59aff1a390d8b17c963 Mon Sep 17 00:00:00 2001 From: zicodxx <> Date: Thu, 20 Nov 2008 18:02:42 +0000 Subject: [PATCH] Small transparency fix for robot weapons; Some timer-Failsafe in robot/boss dying frames; Fixed logical flaw in create_small_fireball_on_object() closing out sound effects on robots --- CHANGELOG.txt | 1 + arch/ogl/ogl.c | 2 +- main/ai2.c | 4 +++- main/object.c | 2 +- 4 files changed, 6 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.txt b/CHANGELOG.txt index 0c561ec7d..2705df9fa 100644 --- a/CHANGELOG.txt +++ b/CHANGELOG.txt @@ -4,6 +4,7 @@ D2X-Rebirth Changelog -------- main/ai2.c: When we reached MAX_BOSS_TELEPORT_SEGS in init_boss_segments, make sure we also escape out of the for-loop - otherwise we still might overflow main/piggy.c: Corrected a small logical mistake in Shareware-HAM recognition +arch/ogl/ogl.c, main/ai2.c, main/object.c: Small transparency fix for robot weapons; Some timer-Failsafe in robot/boss dying frames; Fixed logical flaw in create_small_fireball_on_object() closing out sound effects on robots 20081119 -------- diff --git a/arch/ogl/ogl.c b/arch/ogl/ogl.c index 18a9de2b7..bbbfd86d6 100644 --- a/arch/ogl/ogl.c +++ b/arch/ogl/ogl.c @@ -827,7 +827,7 @@ bool g3_draw_bitmap(vms_vector *pos,fix width,fix height,grs_bitmap *bm, int ori // Define alpha by looking for object TYPE or ID. We do this here so we have it seperated from the rest of the code. if (PlayerCfg.OglAlphaEffects && // if -gl_transparency draw following bitmaps (obj->type==OBJ_FIREBALL || // all types of explosions and energy-effects - (obj->type==OBJ_WEAPON && (obj->id != PROXIMITY_ID && obj->id != SUPERPROX_ID)) || // weapon fire except bombs + (obj->type==OBJ_WEAPON && (obj->id != PROXIMITY_ID && obj->id != SUPERPROX_ID && obj->id != ROBOT_SUPERPROX_ID && obj->id != PMINE_ID)) || // weapon fire except bombs obj->id==POW_EXTRA_LIFE || // extra life obj->id==POW_ENERGY || // energy powerup obj->id==POW_SHIELD_BOOST || // shield boost diff --git a/main/ai2.c b/main/ai2.c index d3d4126c0..23214c207 100644 --- a/main/ai2.c +++ b/main/ai2.c @@ -2069,7 +2069,7 @@ int do_robot_dying_frame(object *objp, fix start_time, fix roll_duration, sbyte } else if (d_rand() < FrameTime*8) create_small_fireball_on_object(objp, (F1_0/2 + d_rand()) * (16 * expl_scale/F1_0)/8, 1); - if (start_time + roll_duration < GameTime) + if (start_time + roll_duration < GameTime || GameTime+(F1_0*2) < start_time) return 1; else return 0; @@ -2092,6 +2092,7 @@ void do_boss_dying_frame(object *objp) rval = do_robot_dying_frame(objp, Boss_dying_start_time, BOSS_DEATH_DURATION, &Boss_dying_sound_playing, Robot_info[objp->id].deathroll_sound, F1_0*4, F1_0*4); if (rval) { + Boss_dying_start_time=GameTime; // make sure following only happens one time! do_controlcen_destroyed_stuff(NULL); explode_object(objp, F1_0/4); digi_link_sound_to_object2(SOUND_BADASS_EXPLOSION, objp-Objects, 0, F2_0, F1_0*512); @@ -2110,6 +2111,7 @@ int do_any_robot_dying_frame(object *objp) rval = do_robot_dying_frame(objp, objp->ctype.ai_info.dying_start_time, min(death_roll/2+1,6)*F1_0, &objp->ctype.ai_info.dying_sound_playing, Robot_info[objp->id].deathroll_sound, death_roll*F1_0/8, death_roll*F1_0/2); if (rval) { + objp->ctype.ai_info.dying_start_time = GameTime; // make sure following only happens one time! explode_object(objp, F1_0/4); digi_link_sound_to_object2(SOUND_BADASS_EXPLOSION, objp-Objects, 0, F2_0, F1_0*512); if ((Current_level_num < 0) && (Robot_info[objp->id].thief)) diff --git a/main/object.c b/main/object.c index e54dff153..69debb615 100644 --- a/main/object.c +++ b/main/object.c @@ -657,7 +657,7 @@ void create_small_fireball_on_object(object *objp, fix size_scale, int sound_fla fix vol = F1_0/2; if (objp->type == OBJ_ROBOT) vol *= 2; - else if (sound_flag) + if (sound_flag) digi_link_sound_to_object(SOUND_EXPLODING_WALL, objp-Objects, 0, vol); } }