diff --git a/code/ai/aicode.cpp b/code/ai/aicode.cpp index 888cfc7fff..343e18c8d4 100644 --- a/code/ai/aicode.cpp +++ b/code/ai/aicode.cpp @@ -9,13 +9,16 @@ /* * $Logfile: /Freespace2/code/Ship/AiCode.cpp $ - * $Revision: 1.93 $ - * $Date: 2007-01-07 01:00:18 $ + * $Revision: 1.94 $ + * $Date: 2007-01-08 00:50:58 $ * $Author: Goober5000 $ * * AI code that does interesting stuff * * $Log: not supported by cvs2svn $ + * Revision 1.93 2007/01/07 01:00:18 Goober5000 + * convert a mission variable to a mission flag + * * Revision 1.92 2006/12/28 00:59:18 wmcoolmon * WMC codebase commit. See pre-commit build thread for details on changes. * @@ -2959,8 +2962,8 @@ void evaluate_object_as_nearest_objnum(eval_nearest_objnum *eno) if (shipp->flags & SF_DYING) return; - // don't fire at a ship arriving or in limbo - if ((shipp->flags & SF_ARRIVING) || (shipp->flags2 & SF2_IN_LIMBO)) + // don't fire at an arriving ship + if (shipp->flags & SF_ARRIVING) return; if (is_ignore_object(aip, OBJ_INDEX(eno->trial_objp))) @@ -14556,8 +14559,6 @@ int ai_need_new_target(object *pl_objp, int target_objnum) return 1; } else if (shipp->team == Ships[pl_objp->instance].team) { return 1; - } else if (shipp->flags2 & SF2_IN_LIMBO) { - return 1; } } diff --git a/code/ai/aiturret.cpp b/code/ai/aiturret.cpp index 1835245134..c99feb64b3 100644 --- a/code/ai/aiturret.cpp +++ b/code/ai/aiturret.cpp @@ -1,12 +1,16 @@ /* * $Logfile: /Freespace2/code/ai/aiturret.cpp $ - * $Revision: 1.50 $ - * $Date: 2007-01-07 12:36:51 $ - * $Author: taylor $ + * $Revision: 1.51 $ + * $Date: 2007-01-08 00:50:58 $ + * $Author: Goober5000 $ * * Functions for AI control of turrets * * $Log: not supported by cvs2svn $ + * Revision 1.50 2007/01/07 12:36:51 taylor + * make fire-on-normal return value a little more obvious + * fix the "infinite genius" move I made by breaking turret movements ;) + * * Revision 1.49 2006/12/28 00:59:18 wmcoolmon * WMC codebase commit. See pre-commit build thread for details on changes. * @@ -481,11 +485,6 @@ int valid_turret_enemy(object *objp, object *turret_parent) return 0; } - //WMC - Or limbo ships - if (shipp->flags2 & SF2_IN_LIMBO) { - return 0; - } - // Goober5000 - don't fire at cargo containers (now specified in ship_types) if ( (sip->class_type >= 0) && !(Ship_types[sip->class_type].ai_bools & STI_AI_TURRETS_ATTACK) ) { return 0; diff --git a/code/freespace2/freespace.cpp b/code/freespace2/freespace.cpp index 1d1375132c..97baff1b10 100644 --- a/code/freespace2/freespace.cpp +++ b/code/freespace2/freespace.cpp @@ -9,13 +9,16 @@ /* * $Logfile: /Freespace2/code/Freespace2/FreeSpace.cpp $ - * $Revision: 2.275 $ - * $Date: 2007-01-07 12:34:36 $ - * $Author: taylor $ + * $Revision: 2.276 $ + * $Date: 2007-01-08 00:50:58 $ + * $Author: Goober5000 $ * * FreeSpace main body * * $Log: not supported by cvs2svn $ + * Revision 2.275 2007/01/07 12:34:36 taylor + * proper envmap generation for OpenGL + * * Revision 2.274 2006/12/28 00:59:20 wmcoolmon * WMC codebase commit. See pre-commit build thread for details on changes. * @@ -3319,10 +3322,7 @@ DCF(warp, "Tests warpin effect") if(warpin) shipfx_warpin_start(&Objects[Ships[idx].objnum]); else - { - Ships[idx].flags2 |= SF2_DEPART_TO_LIMBO; shipfx_warpout_start(&Objects[Ships[idx].objnum]); - } } } else if(idx < 0) @@ -3332,10 +3332,7 @@ DCF(warp, "Tests warpin effect") if(warpin) shipfx_warpin_start(&Objects[Player_ai->target_objnum]); else - { - Ships[idx].flags2 |= SF2_DEPART_TO_LIMBO; shipfx_warpout_start(&Objects[Player_ai->target_objnum]); - } } } } diff --git a/code/hud/hudescort.cpp b/code/hud/hudescort.cpp index 02351de48d..38bd7b2b27 100644 --- a/code/hud/hudescort.cpp +++ b/code/hud/hudescort.cpp @@ -9,13 +9,18 @@ /* * $Logfile: /Freespace2/code/Hud/HUDescort.cpp $ - * $Revision: 2.31 $ - * $Date: 2006-07-09 01:55:41 $ + * $Revision: 2.32 $ + * $Date: 2007-01-08 00:50:58 $ * $Author: Goober5000 $ * * C module for managing and displaying ships that are in an escort * * $Log: not supported by cvs2svn $ + * Revision 2.31 2006/07/09 01:55:41 Goober5000 + * consolidate the "for reals" crap into a proper ship flag; also move the limbo flags over to SF2_*; etc. + * this should fix Mantis #977 + * --Goober5000 + * * Revision 2.30 2006/06/07 04:39:30 wmcoolmon * Limbo flag support * @@ -693,7 +698,7 @@ void hud_escort_cull_list() Assert( objnum >=0 && objnum < MAX_OBJECTS ); object *objp = &Objects[objnum]; - if ((objp->flags & OF_SHOULD_BE_DEAD) || (Ships[objp->instance].flags & SF_HIDDEN_FROM_SENSORS) || (Ships[objp->instance].flags2 & SF2_IN_LIMBO)) { + if ((objp->flags & OF_SHOULD_BE_DEAD) || (Ships[objp->instance].flags & SF_HIDDEN_FROM_SENSORS)) { hud_remove_ship_from_escort_index(i, objnum); i--; } diff --git a/code/hud/hudtarget.cpp b/code/hud/hudtarget.cpp index 59acb53985..f3336120de 100644 --- a/code/hud/hudtarget.cpp +++ b/code/hud/hudtarget.cpp @@ -9,13 +9,18 @@ /* * $Logfile: /Freespace2/code/Hud/HUDtarget.cpp $ - * $Revision: 2.97 $ - * $Date: 2007-01-07 12:53:35 $ - * $Author: taylor $ + * $Revision: 2.98 $ + * $Date: 2007-01-08 00:50:58 $ + * $Author: Goober5000 $ * * C module to provide HUD targeting functions * * $Log: not supported by cvs2svn $ + * Revision 2.97 2007/01/07 12:53:35 taylor + * add position info for weapon energy text + * make sure that we can't target a hidden jumpnode + * rest of the weapon switch fix + * * Revision 2.96 2007/01/07 03:09:53 Goober5000 * fix bug where built-in lament messages were never played * @@ -596,7 +601,7 @@ // If any of these bits in the ship->flags are set, ignore this ship when targetting int TARGET_SHIP_IGNORE_FLAGS = (SF_EXPLODED | SF_DEPART_WARP | SF_DYING | SF_ARRIVING_STAGE_1 | SF_HIDDEN_FROM_SENSORS); -int TARGET_SHIP_IGNORE_FLAGS_2 = (SF2_IN_LIMBO); +int TARGET_SHIP_IGNORE_FLAGS_2 = (0); // Global values for the target bracket width and height, used for debugging diff --git a/code/object/collideshipship.cpp b/code/object/collideshipship.cpp index 6c7508f505..3c5c01e92b 100644 --- a/code/object/collideshipship.cpp +++ b/code/object/collideshipship.cpp @@ -9,13 +9,16 @@ /* * $Logfile: /Freespace2/code/Object/CollideShipShip.cpp $ - * $Revision: 2.20 $ - * $Date: 2006-12-28 00:59:39 $ - * $Author: wmcoolmon $ + * $Revision: 2.21 $ + * $Date: 2007-01-08 00:50:58 $ + * $Author: Goober5000 $ * * Routines to detect collisions and do physics, damage, etc for ships and ships * * $Log: not supported by cvs2svn $ + * Revision 2.20 2006/12/28 00:59:39 wmcoolmon + * WMC codebase commit. See pre-commit build thread for details on changes. + * * Revision 2.19 2006/07/09 01:55:41 Goober5000 * consolidate the "for reals" crap into a proper ship flag; also move the limbo flags over to SF2_*; etc. * this should fix Mantis #977 @@ -711,10 +714,6 @@ int ship_ship_check_collision(collision_info_struct *ship_ship_hit_info, vec3d * if ( Ships[num].flags & SF_ARRIVING ) return 0; - // WMC - We don't need collision to LIMBO! - if ( Ships[num].flags2 & SF2_IN_LIMBO ) - return 0; - // Don't do collision detection for docking ships, since they will always collide while trying to dock if ( ships_are_docking(heavy_obj, light_obj) ) { return 0; @@ -1895,8 +1894,8 @@ int collide_ship_ship( obj_pair * pair ) sif_b_flags = Ship_info[Ships[B->instance].ship_info_index].flags; // if ship is huge and warping in - if ( ((Ships[A->instance].flags & SF_ARRIVING_STAGE_1 || Ships[A->instance].flags2 & SF2_IN_LIMBO) && (sif_a_flags & SIF_HUGE_SHIP)) - || ((Ships[B->instance].flags & SF_ARRIVING_STAGE_1 || Ships[B->instance].flags2 & SF2_IN_LIMBO) && (sif_b_flags & SIF_HUGE_SHIP)) ) { + if ( ((Ships[A->instance].flags & SF_ARRIVING_STAGE_1) && (sif_a_flags & SIF_HUGE_SHIP)) + || ((Ships[B->instance].flags & SF_ARRIVING_STAGE_1) && (sif_b_flags & SIF_HUGE_SHIP)) ) { pair->next_check_time = timestamp(0); // check next time return 0; } diff --git a/code/object/collideshipweapon.cpp b/code/object/collideshipweapon.cpp index 8906288d99..2534083ae0 100644 --- a/code/object/collideshipweapon.cpp +++ b/code/object/collideshipweapon.cpp @@ -9,13 +9,16 @@ /* * $Logfile: /Freespace2/code/Object/CollideShipWeapon.cpp $ - * $Revision: 2.33 $ - * $Date: 2006-12-28 00:59:39 $ - * $Author: wmcoolmon $ + * $Revision: 2.34 $ + * $Date: 2007-01-08 00:50:58 $ + * $Author: Goober5000 $ * * Routines to detect collisions and do physics, damage, etc for weapons and ships * * $Log: not supported by cvs2svn $ + * Revision 2.33 2006/12/28 00:59:39 wmcoolmon + * WMC codebase commit. See pre-commit build thread for details on changes. + * * Revision 2.32 2006/10/08 02:05:38 Goober5000 * fix forum links * @@ -416,10 +419,6 @@ int ship_weapon_check_collision(object * ship_obj, object * weapon_obj, float ti if ( shipp->flags & SF_ARRIVING ) return 0; - // or for limbo - if ( shipp->flags2 & SF2_IN_LIMBO ) - return 0; - // if one object is a capital, only check player and player weapons with // the capital -- too slow for now otherwise. // if ( Polygon_models[Ships[num].modelnum].use_grid && !( (other_obj == Player_obj) || (&Objects[other_obj->parent] == Player_obj)) ) diff --git a/code/parse/lua.cpp b/code/parse/lua.cpp index 8df685895a..b5493eaf2a 100644 --- a/code/parse/lua.cpp +++ b/code/parse/lua.cpp @@ -4509,29 +4509,6 @@ ADE_VIRTVAR(HitpointsMax, l_Ship, "number", "Total hitpoints") return ade_set_args(L, "f", shipp->ship_max_hull_strength); } -ADE_VIRTVAR(IsInLimbo, l_Ship, "boolean", "Ship's limbo status") -{ - object_h *objh; - bool newlimbo = false; - if(!ade_get_args(L, "o|b", l_Ship.GetPtr(&objh), &newlimbo)) - return ADE_RETURN_NIL; - - if(!objh->IsValid()) - return ADE_RETURN_NIL; - - ship *shipp = &Ships[objh->objp->instance]; - - if(ADE_SETTING_VAR) - { - if(newlimbo) - shipp->flags2 |= SF2_IN_LIMBO; - else - shipp->flags2 &= ~SF2_IN_LIMBO; - } - - return ade_set_args(L, "b", (shipp->flags2 & SF2_IN_LIMBO) != 0); -} - ADE_VIRTVAR(Model, l_Ship, "model", "Ship's model") { object_h *objh; @@ -4836,18 +4813,15 @@ ADE_FUNC(warpIn, l_Ship, NULL, "True", "Warps ship in") return ADE_RETURN_TRUE; } -ADE_FUNC(warpOut, l_Ship, "[boolean Departing]", "True", "Warps ship out; argument specifies whether ship cannot warp back in or not.") +ADE_FUNC(warpOut, l_Ship, "[boolean Departing]", "True", "Warps ship out") { object_h *objh; - bool b; - if(!ade_get_args(L, "o|b", l_Ship.GetPtr(&objh), &b)) + if(!ade_get_args(L, "o", l_Ship.GetPtr(&objh))) return ADE_RETURN_NIL; if(!objh->IsValid()) return ADE_RETURN_NIL; - if (!b) - Ships[objh->objp->instance].flags2 |= SF2_DEPART_TO_LIMBO; shipfx_warpout_start(objh->objp); return ADE_RETURN_TRUE; diff --git a/code/radar/radar.cpp b/code/radar/radar.cpp index 572926ebab..3b4a383c8f 100644 --- a/code/radar/radar.cpp +++ b/code/radar/radar.cpp @@ -9,13 +9,16 @@ /* * $Logfile: /Freespace2/code/Radar/Radar.cpp $ - * $Revision: 2.25 $ - * $Date: 2006-12-28 00:59:48 $ - * $Author: wmcoolmon $ + * $Revision: 2.26 $ + * $Date: 2007-01-08 00:50:59 $ + * $Author: Goober5000 $ * * C module containg functions to display and manage the radar * * $Log: not supported by cvs2svn $ + * Revision 2.25 2006/12/28 00:59:48 wmcoolmon + * WMC codebase commit. See pre-commit build thread for details on changes. + * * Revision 2.24 2006/07/09 01:55:41 Goober5000 * consolidate the "for reals" crap into a proper ship flag; also move the limbo flags over to SF2_*; etc. * this should fix Mantis #977 @@ -418,12 +421,6 @@ void radar_plot_object_std( object *objp ) switch ( objp->type ) { case OBJ_SHIP: // Place to cull ships, such as NavBuoys - //WMC - No limbo ships on radar. - //As far as the radar is concerned, they don't even exist. - if (Ships[objp->instance].flags2 & SF2_IN_LIMBO) { - return; - } - break; case OBJ_JUMP_NODE: diff --git a/code/radar/radarorb.cpp b/code/radar/radarorb.cpp index 2d6c30457b..a22f2ce1dd 100644 --- a/code/radar/radarorb.cpp +++ b/code/radar/radarorb.cpp @@ -9,13 +9,18 @@ /* * $Logfile: /Freespace2/code/Radar/Radarorb.cpp $ - * $Revision: 1.25 $ - * $Date: 2006-07-09 01:55:41 $ + * $Revision: 1.26 $ + * $Date: 2007-01-08 00:50:59 $ * $Author: Goober5000 $ * * C module containg functions to display and manage the "orb" radar mode * * $Log: not supported by cvs2svn $ + * Revision 1.25 2006/07/09 01:55:41 Goober5000 + * consolidate the "for reals" crap into a proper ship flag; also move the limbo flags over to SF2_*; etc. + * this should fix Mantis #977 + * --Goober5000 + * * Revision 1.24 2006/06/07 04:44:57 wmcoolmon * Limbo flag support * @@ -324,12 +329,6 @@ void radar_plot_object_orb( object *objp ) switch ( objp->type ) { case OBJ_SHIP: // Place to cull ships, such as NavBuoys - //WMC - No limbo ships on radar. - //As far as the radar is concerned, they don't even exist. - if (Ships[objp->instance].flags2 & SF2_IN_LIMBO) { - return; - } - break; case OBJ_JUMP_NODE: diff --git a/code/ship/awacs.cpp b/code/ship/awacs.cpp index e1413eab60..77e94ecaaa 100644 --- a/code/ship/awacs.cpp +++ b/code/ship/awacs.cpp @@ -9,13 +9,16 @@ /* * $Logfile: /Freespace2/code/Ship/AWACS.cpp $ - * $Revision: 2.30 $ - * $Date: 2006-09-11 06:47:59 $ - * $Author: taylor $ + * $Revision: 2.31 $ + * $Date: 2007-01-08 00:50:59 $ + * $Author: Goober5000 $ * * all sorts of cool stuff about ships * * $Log: not supported by cvs2svn $ + * Revision 2.30 2006/09/11 06:47:59 taylor + * compiler warning fixes + * * Revision 2.29 2006/07/09 01:55:41 Goober5000 * consolidate the "for reals" crap into a proper ship flag; also move the limbo flags over to SF2_*; etc. * this should fix Mantis #977 @@ -316,10 +319,6 @@ void awacs_update_all_levels() if ((shipp->flags & SF_DYING) || (shipp->flags & SF_DEPARTING) || (shipp->flags & SF_ARRIVING)) continue; - // ignore limbo ships - if (shipp->flags2 & SF2_IN_LIMBO) - continue; - // only look at ships that have awacs subsystems if (!(Ship_info[shipp->ship_info_index].flags & SIF_HAS_AWACS)) continue; @@ -567,10 +566,6 @@ void team_visibility_update() if ((shipp->flags & SF_DYING) || (shipp->flags & SF_DEPARTING) || (shipp->flags & SF_ARRIVING)) continue; - // ignore limbo ships - if (shipp->flags2 & SF2_IN_LIMBO) - continue; - // check if ship if flagged as invisible if (shipp->flags & SF_HIDDEN_FROM_SENSORS) continue; diff --git a/code/ship/ship.cpp b/code/ship/ship.cpp index a8409903f4..5f895a50d9 100644 --- a/code/ship/ship.cpp +++ b/code/ship/ship.cpp @@ -10,13 +10,17 @@ /* * $Logfile: /Freespace2/code/Ship/Ship.cpp $ - * $Revision: 2.393 $ - * $Date: 2007-01-07 21:28:11 $ + * $Revision: 2.394 $ + * $Date: 2007-01-08 00:50:59 $ * $Author: Goober5000 $ * * Ship (and other object) handling functions * * $Log: not supported by cvs2svn $ + * Revision 2.393 2007/01/07 21:28:11 Goober5000 + * yet more tweaks to the WCS death scream stuff + * added a ship flag to force screaming + * * Revision 2.392 2007/01/07 12:59:54 taylor * fix thruster 2 length factor tbl entry so that it has the proper name * @@ -6202,8 +6206,7 @@ void ship_render(object * obj) // Make ships that are warping in not render during stage 1 - //WMC - Or limbo. - if (!(is_first_stage_arrival) && !(shipp->flags2 & SF2_IN_LIMBO)) + if (!is_first_stage_arrival) { if ( Ship_shadows && shipfx_in_shadow( obj ) ) { light_set_shadow(1); @@ -7028,14 +7031,6 @@ void ship_departed( int num ) else mission_log_add_entry(LOG_SHIP_DEPARTED, sp->ship_name, NULL, sp->wingnum); - if (sp->flags2 & SF2_DEPART_TO_LIMBO) - { - sp->flags &= ~SF_DEPARTING; - sp->flags2 &= ~SF2_DEPART_TO_LIMBO; - sp->flags2 |= SF2_IN_LIMBO; - return; - } - ai_ship_destroy(num, SEF_DEPARTED); // should still do AI cleanup after ship has departed // don't bother doing this for demo playback - we don't keep track of wing info @@ -8249,13 +8244,6 @@ void ship_process_post(object * obj, float frametime) shipp->shield_hits = 0; - //WMC - Ships in limbo do nothing. - //Nothing at all. - // - //>_> - if (shipp->flags2 & SF2_IN_LIMBO) - return; - update_ets(obj, frametime); afterburners_update(obj, frametime); diff --git a/code/ship/ship.h b/code/ship/ship.h index 819e00bb89..8f1be8482f 100644 --- a/code/ship/ship.h +++ b/code/ship/ship.h @@ -9,13 +9,17 @@ /* * $Logfile: /Freespace2/code/Ship/Ship.h $ - * $Revision: 2.173 $ - * $Date: 2007-01-07 21:28:11 $ + * $Revision: 2.174 $ + * $Date: 2007-01-08 00:50:59 $ * $Author: Goober5000 $ * * all sorts of cool stuff about ships * * $Log: not supported by cvs2svn $ + * Revision 2.173 2007/01/07 21:28:11 Goober5000 + * yet more tweaks to the WCS death scream stuff + * added a ship flag to force screaming + * * Revision 2.172 2007/01/07 12:59:54 taylor * fix thruster 2 length factor tbl entry so that it has the proper name * @@ -1233,8 +1237,6 @@ typedef struct ship_subsys_info { #define SF2_NO_DEATH_SCREAM (1<<15) // Goober5000 - for WCS #define SF2_ALWAYS_DEATH_SCREAM (1<<16) // Goober5000 - for WCS #define SF2_GLOWMAPS_DISABLED (1<<17) // taylor - to disable glow maps -#define SF2_IN_LIMBO (1<<18) // WMC - Ship isn't in mission, but still in Ships array -#define SF2_DEPART_TO_LIMBO (1<<19) // WMC/Goober5000 // If any of these bits in the ship->flags are set, ignore this ship when targetting extern int TARGET_SHIP_IGNORE_FLAGS; diff --git a/code/ship/shipfx.cpp b/code/ship/shipfx.cpp index cf814977d1..319d828e74 100644 --- a/code/ship/shipfx.cpp +++ b/code/ship/shipfx.cpp @@ -9,13 +9,16 @@ /* * $Logfile: /Freespace2/code/Ship/ShipFX.cpp $ - * $Revision: 2.78 $ - * $Date: 2006-12-28 00:59:48 $ - * $Author: wmcoolmon $ + * $Revision: 2.79 $ + * $Date: 2007-01-08 00:50:59 $ + * $Author: Goober5000 $ * * Routines for ship effects (as in special) * * $Log: not supported by cvs2svn $ + * Revision 2.78 2006/12/28 00:59:48 wmcoolmon + * WMC codebase commit. See pre-commit build thread for details on changes. + * * Revision 2.77 2006/11/16 01:11:28 taylor * handle knossos warp effect flip in a slightly better, slighter safer way (Mantis bug #1048, plus a couple that weren't filed) * @@ -1092,9 +1095,6 @@ void shipfx_warpin_start( object *objp ) Script_system.RunCondition(CHA_WARPIN, 0, NULL, objp); } - if (shipp->flags2 & SF2_IN_LIMBO) - shipp->flags2 &= ~SF2_IN_LIMBO; - // if there is no arrival warp, then skip the whole thing if (shipp->flags & SF_NO_ARRIVAL_WARP) { @@ -1290,14 +1290,13 @@ void shipfx_warpout_helper(object *objp, dock_function_info *infop) } else { - if (!(Ships[objp->instance].flags2 & SF2_DEPART_TO_LIMBO)) - objp->flags |= OF_SHOULD_BE_DEAD; + objp->flags |= OF_SHOULD_BE_DEAD; if (objp->type == OBJ_SHIP) ship_departed(objp->instance); } } - + // This is called to actually warp this object out // after all the flashy fx are done, or if the flashy fx // don't work for some reason. OR to skip the flashy fx.