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
This commit is contained in:
Goober5000 committed 2006-07-09 01:55:42 +00:00
1 parent f6394cdef8
commit fb22ef4804
19 files changed
+232 -148

No files matched your search

+12 -4
View File
@@ -9,13 +9,17 @@
/*
* $Logfile: /Freespace2/code/Ship/AiCode.cpp $
* $Revision: 1.80 $
* $Date: 2006-07-06 21:00:12 $
* $Revision: 1.81 $
* $Date: 2006-07-09 01:55:41 $
* $Author: Goober5000 $
*
* AI code that does interesting stuff
*
* $Log: not supported by cvs2svn $
* Revision 1.80 2006/07/06 21:00:12 Goober5000
* remove obsolete (and hackish) flag
* --Goober5000
*
* Revision 1.79 2006/07/05 23:48:20 Goober5000
* fix for Mantis #571
* --Goober5000/Backslash
@@ -2910,7 +2914,11 @@ void evaluate_object_as_nearest_objnum(eval_nearest_objnum *eno)
return;
// Don't keep firing at a ship that is in its death throes.
if (shipp->flags & (SF_DYING | SF_ARRIVING | SF_LIMBO))
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))
return;
if (is_ignore_object(aip, OBJ_INDEX(eno->trial_objp)))
@@ -14486,7 +14494,7 @@ 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->flags & SF_LIMBO) {
} else if (shipp->flags2 & SF2_IN_LIMBO) {
return 1;
}
}
+11 -4
View File
@@ -1,12 +1,15 @@
/*
* $Logfile: /Freespace2/code/ai/aiturret.cpp $
* $Revision: 1.40 $
* $Date: 2006-06-07 04:36:52 $
* $Author: wmcoolmon $
* $Revision: 1.41 $
* $Date: 2006-07-09 01:55:41 $
* $Author: Goober5000 $
*
* Functions for AI control of turrets
*
* $Log: not supported by cvs2svn $
* Revision 1.40 2006/06/07 04:36:52 wmcoolmon
* Fix muzzleflashes for non-flak weapons. Begin commit of limbo code.
*
* Revision 1.39 2006/06/01 04:40:41 taylor
* be sure to to reset ok_to_fire between weapon checks to make sure we don't count something by mistake
*
@@ -431,8 +434,12 @@ int valid_turret_enemy(object *objp, object *turret_parent)
}
// don't shoot at arriving ships
if (shipp->flags & SF_ARRIVING) {
return 0;
}
//WMC - Or limbo ships
if (shipp->flags & (SF_ARRIVING | SF_LIMBO)) {
if (shipp->flags2 & SF2_IN_LIMBO) {
return 0;
}
+5 -8
View File
@@ -9,9 +9,9 @@
/*
* $Logfile: /Freespace2/code/Demo/Demo.cpp $
* $Revision: 2.9 $
* $Date: 2006-06-07 04:38:29 $
* $Author: wmcoolmon $
* $Revision: 2.10 $
* $Date: 2006-07-09 01:55:41 $
* $Author: Goober5000 $
*
*
* $Log: not supported by cvs2svn $
@@ -684,14 +684,13 @@ void demo_POST_warpout(int signature, int ship_flags)
}
// post a departed event
void demo_POST_departed(int signature, int ship_flags, int for_reals)
void demo_POST_departed(int signature, int ship_flags)
{
// write it
ubyte event = DE_OBJ_DEPARTED;
DEMO_UBYTE(event);
DEMO_INT(signature);
DEMO_INT(ship_flags);
DEMO_INT(for_reals);
// up the event count
Demo_frame_events++;
@@ -999,16 +998,14 @@ int demo_playback_seek_sub(int frame_size)
int obj_sig = 0;
int ship_flags = 0;
int ship_index = 0;
int for_reals;
// get the data and ship
DEMO_INT(obj_sig);
DEMO_INT(ship_flags);
DEMO_INT(for_reals);
ship_index = ship_get_by_signature(obj_sig);
if(ship_index >= 0){
Ships[ship_index].flags = ship_flags;
ship_departed(ship_index, for_reals==1 ? true : false);
ship_departed(ship_index);
}
}
break;
+4 -4
View File
@@ -9,9 +9,9 @@
/*
* $Logfile: /Freespace2/code/Demo/Demo.h $
* $Revision: 2.3 $
* $Date: 2006-06-07 04:38:29 $
* $Author: wmcoolmon $
* $Revision: 2.4 $
* $Date: 2006-07-09 01:55:41 $
* $Author: Goober5000 $
*
*
* $Log: not supported by cvs2svn $
@@ -115,7 +115,7 @@ void demo_POST_warpin(int signature, int ship_flags);
void demo_POST_warpout(int signature, int ship_flags);
// post a departed event
void demo_POST_departed(int signature, int ship_flags, int for_reals);
void demo_POST_departed(int signature, int ship_flags);
// post a ship kill event
void demo_POST_ship_kill(object *objp);
+15 -4
View File
@@ -9,13 +9,18 @@
/*
* $Logfile: /Freespace2/code/Freespace2/FreeSpace.cpp $
* $Revision: 2.252 $
* $Date: 2006-07-06 04:06:03 $
* $Revision: 2.253 $
* $Date: 2006-07-09 01:55:41 $
* $Author: Goober5000 $
*
* FreeSpace main body
*
* $Log: not supported by cvs2svn $
* Revision 2.252 2006/07/06 04:06:03 Goober5000
* 1) complete (almost) changeover to reorganized texture mapping system
* 2) finally fix texture animation; textures now animate at the correct speed
* --Goober5000
*
* Revision 2.251 2006/07/05 23:35:42 Goober5000
* cvs comment tweaks
*
@@ -3226,7 +3231,10 @@ DCF(warp, "Tests warpin effect")
if(warpin)
shipfx_warpin_start(&Objects[Ships[idx].objnum]);
else
shipfx_warpout_start(&Objects[Ships[idx].objnum], false);
{
Ships[idx].flags2 |= SF2_DEPART_TO_LIMBO;
shipfx_warpout_start(&Objects[Ships[idx].objnum]);
}
}
}
else if(idx < 0)
@@ -3236,7 +3244,10 @@ DCF(warp, "Tests warpin effect")
if(warpin)
shipfx_warpin_start(&Objects[Player_ai->target_objnum]);
else
shipfx_warpout_start(&Objects[Player_ai->target_objnum], false);
{
Ships[idx].flags2 |= SF2_DEPART_TO_LIMBO;
shipfx_warpout_start(&Objects[Player_ai->target_objnum]);
}
}
}
}
+9 -4
View File
@@ -9,13 +9,16 @@
/*
* $Logfile: /Freespace2/code/Hud/HUDescort.cpp $
* $Revision: 2.30 $
* $Date: 2006-06-07 04:39:30 $
* $Author: wmcoolmon $
* $Revision: 2.31 $
* $Date: 2006-07-09 01:55:41 $
* $Author: Goober5000 $
*
* C module for managing and displaying ships that are in an escort
*
* $Log: not supported by cvs2svn $
* Revision 2.30 2006/06/07 04:39:30 wmcoolmon
* Limbo flag support
*
* Revision 2.29 2006/02/16 05:00:01 taylor
* various bmpman related fixes
* - some new error checking (and fixes related to that) and cleanup
@@ -688,7 +691,9 @@ void hud_escort_cull_list()
for ( i = 0; i < Num_escort_ships; i++ ) {
objnum = Escort_ships[i].objnum;
Assert( objnum >=0 && objnum < MAX_OBJECTS );
if ( Objects[objnum].flags & OF_SHOULD_BE_DEAD || Ships[Objects[objnum].instance].flags & (SF_HIDDEN_FROM_SENSORS | SF_LIMBO) ) {
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)) {
hud_remove_ship_from_escort_index(i, objnum);
i--;
}
+36 -25
View File
@@ -9,13 +9,16 @@
/*
* $Logfile: /Freespace2/code/Hud/HUDtarget.cpp $
* $Revision: 2.91 $
* $Date: 2006-07-02 22:53:53 $
* $Author: karajorma $
* $Revision: 2.92 $
* $Date: 2006-07-09 01:55:41 $
* $Author: Goober5000 $
*
* C module to provide HUD targeting functions
*
* $Log: not supported by cvs2svn $
* Revision 2.91 2006/07/02 22:53:53 karajorma
* Restore the Hostile Warning triangles and the "On your Six" warning messages.
*
* Revision 2.90 2006/06/24 18:01:55 Goober5000
* doh! sorry for blaming this on you, WMC
* --Goober5000
@@ -575,7 +578,9 @@
// 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_LIMBO|SF_HIDDEN_FROM_SENSORS);
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);
// Global values for the target bracket width and height, used for debugging
int Hud_target_w, Hud_target_h;
@@ -1866,7 +1871,7 @@ void hud_target_common(int team_mask, int next_flag)
}
if ( A->type == OBJ_SHIP ) {
if ( Ships[A->instance].flags & TARGET_SHIP_IGNORE_FLAGS ){
if ( (Ships[A->instance].flags & TARGET_SHIP_IGNORE_FLAGS) || (Ships[A->instance].flags2 & TARGET_SHIP_IGNORE_FLAGS_2) ){
continue;
}
is_ship=1;
@@ -1886,7 +1891,7 @@ void hud_target_common(int team_mask, int next_flag)
}
}
if ( A == Player_obj || (shipp->flags & TARGET_SHIP_IGNORE_FLAGS) ){
if ( (A == Player_obj) || (shipp->flags & TARGET_SHIP_IGNORE_FLAGS) || (shipp->flags2 & TARGET_SHIP_IGNORE_FLAGS_2) ){
continue;
}
@@ -2051,7 +2056,7 @@ void hud_target_missile(object *source_obj, int next_flag)
}
// check if ignore
if ( Ships[A->instance].flags & TARGET_SHIP_IGNORE_FLAGS ){
if ( (Ships[A->instance].flags & TARGET_SHIP_IGNORE_FLAGS) || (Ships[A->instance].flags2 & TARGET_SHIP_IGNORE_FLAGS_2) ){
continue;
}
@@ -2115,7 +2120,7 @@ void hud_target_uninspected_cargo(int next_flag)
shipp = &Ships[A->instance]; // get a pointer to the ship information
if ( shipp->flags & TARGET_SHIP_IGNORE_FLAGS ) {
if ( (shipp->flags & TARGET_SHIP_IGNORE_FLAGS) || (shipp->flags2 & TARGET_SHIP_IGNORE_FLAGS_2) ) {
continue;
}
@@ -2169,7 +2174,7 @@ void hud_target_newest_ship()
A = &Objects[so->objnum];
shipp = &Ships[A->instance]; // get a pointer to the ship information
if ( (A == Player_obj) || (shipp->flags & TARGET_SHIP_IGNORE_FLAGS) )
if ( (A == Player_obj) || (shipp->flags & TARGET_SHIP_IGNORE_FLAGS) || (shipp->flags2 & TARGET_SHIP_IGNORE_FLAGS_2) )
continue;
// ignore navbuoys
@@ -2634,7 +2639,7 @@ void evaluate_ship_as_closest_target(esct *esct)
}
// check if player or ignore ship
if ( (esct->shipp->objnum == OBJ_INDEX(Player_obj)) || (esct->shipp->flags & TARGET_SHIP_IGNORE_FLAGS) ) {
if ( (esct->shipp->objnum == OBJ_INDEX(Player_obj)) || (esct->shipp->flags & TARGET_SHIP_IGNORE_FLAGS) || (esct->shipp->flags2 & TARGET_SHIP_IGNORE_FLAGS_2) ) {
return;
}
@@ -2739,7 +2744,7 @@ int hud_target_closest(int team_mask, int attacked_objnum, int play_fail_snd, in
if ( (attacked_objnum >= 0) && (attacked_objnum != player_obj_index) ) {
// bail if player does not have target
if ( Player_ai->target_objnum == -1) {
if ( Player_ai->target_objnum == -1 ) {
goto Target_closest_done;
}
@@ -2748,7 +2753,7 @@ int hud_target_closest(int team_mask, int attacked_objnum, int play_fail_snd, in
}
// bail if ship is to be ignored
if (Ships[Objects[attacked_objnum].instance].flags & TARGET_SHIP_IGNORE_FLAGS) {
if ( (Ships[Objects[attacked_objnum].instance].flags & TARGET_SHIP_IGNORE_FLAGS) || (Ships[Objects[attacked_objnum].instance].flags2 & TARGET_SHIP_IGNORE_FLAGS_2) ) {
goto Target_closest_done;
}
}
@@ -2908,7 +2913,7 @@ void hud_target_targets_target()
goto ttt_fail;
}
if ( Ships[objp->instance].flags & TARGET_SHIP_IGNORE_FLAGS ) {
if ( (Ships[objp->instance].flags & TARGET_SHIP_IGNORE_FLAGS) || (Ships[objp->instance].flags2 & TARGET_SHIP_IGNORE_FLAGS_2) ) {
goto ttt_fail;
}
@@ -2995,7 +3000,7 @@ void hud_target_in_reticle_new()
if ( A->type == OBJ_SHIP ) {
if ( Ships[A->instance].flags & TARGET_SHIP_IGNORE_FLAGS ){
if ( (Ships[A->instance].flags & TARGET_SHIP_IGNORE_FLAGS) || (Ships[A->instance].flags2 & TARGET_SHIP_IGNORE_FLAGS_2) ){
continue;
}
}
@@ -3083,7 +3088,7 @@ void hud_target_in_reticle_old()
}
if ( A->type == OBJ_SHIP ) {
if ( Ships[A->instance].flags & TARGET_SHIP_IGNORE_FLAGS ){
if ( (Ships[A->instance].flags & TARGET_SHIP_IGNORE_FLAGS) || (Ships[A->instance].flags2 & TARGET_SHIP_IGNORE_FLAGS_2) ){
continue;
}
}
@@ -3158,7 +3163,7 @@ void hud_target_subsystem_in_reticle()
int shipnum = targetp->instance;
if ( targetp->type == OBJ_SHIP ) {
if ( Ships[shipnum].flags & TARGET_SHIP_IGNORE_FLAGS ) {
if ( (Ships[shipnum].flags & TARGET_SHIP_IGNORE_FLAGS) || (Ships[shipnum].flags2 & TARGET_SHIP_IGNORE_FLAGS_2) ) {
return;
}
}
@@ -4213,7 +4218,7 @@ void hud_show_hostile_triangle()
aip = &Ai_info[Ships[A->instance].ai_index];
// dont look at ignore ships
if ( sp->flags & TARGET_SHIP_IGNORE_FLAGS ) {
if ( (sp->flags & TARGET_SHIP_IGNORE_FLAGS) || (sp->flags2 & TARGET_SHIP_IGNORE_FLAGS_2) ) {
continue;
}
@@ -5880,7 +5885,7 @@ void hud_target_next_list(int hostile, int next_flag)
A = &Objects[so->objnum];
shipp = &Ships[A->instance]; // get a pointer to the ship information
if ( (A == Player_obj) || (shipp->flags & TARGET_SHIP_IGNORE_FLAGS) )
if ( (A == Player_obj) || (shipp->flags & TARGET_SHIP_IGNORE_FLAGS) || (shipp->flags2 & TARGET_SHIP_IGNORE_FLAGS_2) )
continue;
// choose from the correct team
@@ -6078,7 +6083,7 @@ int hud_target_closest_repair_ship(int goal_objnum)
continue;
}
if ( (A == Player_obj) || (shipp->flags & TARGET_SHIP_IGNORE_FLAGS) )
if ( (A == Player_obj) || (shipp->flags & TARGET_SHIP_IGNORE_FLAGS) || (shipp->flags2 & TARGET_SHIP_IGNORE_FLAGS_2) )
continue;
// only consider friendly ships
@@ -6125,10 +6130,13 @@ int hud_target_closest_repair_ship(int goal_objnum)
void hud_target_toggle_hidden_from_sensors()
{
if ( TARGET_SHIP_IGNORE_FLAGS & SF_HIDDEN_FROM_SENSORS ) {
if (TARGET_SHIP_IGNORE_FLAGS & SF_HIDDEN_FROM_SENSORS)
{
TARGET_SHIP_IGNORE_FLAGS &= ~SF_HIDDEN_FROM_SENSORS;
HUD_sourced_printf(HUD_SOURCE_HIDDEN, NOX("Target hiding from sensors disabled"));
} else {
}
else
{
TARGET_SHIP_IGNORE_FLAGS |= SF_HIDDEN_FROM_SENSORS;
HUD_sourced_printf(HUD_SOURCE_HIDDEN, NOX("Target hiding from sensors enabled"));
}
@@ -6148,7 +6156,7 @@ void hud_target_closest_uninspected_object()
A = &Objects[so->objnum];
shipp = &Ships[A->instance]; // get a pointer to the ship information
if ( (A == Player_obj) || (shipp->flags & TARGET_SHIP_IGNORE_FLAGS) ){
if ( (A == Player_obj) || (shipp->flags & TARGET_SHIP_IGNORE_FLAGS) || (shipp->flags2 & TARGET_SHIP_IGNORE_FLAGS_2) ){
continue;
}
@@ -6210,7 +6218,7 @@ void hud_target_uninspected_object(int next_flag)
A = &Objects[so->objnum];
shipp = &Ships[A->instance]; // get a pointer to the ship information
if ( (A == Player_obj) || (shipp->flags & TARGET_SHIP_IGNORE_FLAGS) )
if ( (A == Player_obj) || (shipp->flags & TARGET_SHIP_IGNORE_FLAGS) || (shipp->flags2 & TARGET_SHIP_IGNORE_FLAGS_2) )
continue;
// ignore all non-cargo carrying craft
@@ -6327,7 +6335,7 @@ int hud_target_last_transmit_newest()
return latest_slot;
}
// called externally to set the player target to the last ship which sent a tranmission to the player
// called externally to set the player target to the last ship which sent a transmission to the player
void hud_target_last_transmit()
{
int i;
@@ -6346,6 +6354,7 @@ void hud_target_last_transmit()
int play_fail_sound = 1;
int transmit_index = Transmit_target_current_slot;
Assert(transmit_index >= 0);
for ( i = 0; i < MAX_TRANSMIT_TARGETS; i++ ) {
if ( Transmit_target_list[transmit_index].objnum >= 0 ) {
int transmit_objnum = Transmit_target_list[transmit_index].objnum;
@@ -6354,7 +6363,9 @@ void hud_target_last_transmit()
play_fail_sound = 0;
} else {
if ( Transmit_target_list[transmit_index].objsig == Objects[Transmit_target_list[transmit_index].objnum].signature ) {
if ( !(Ships[Objects[transmit_objnum].instance].flags & TARGET_SHIP_IGNORE_FLAGS) ) {
if ( !(Ships[Objects[transmit_objnum].instance].flags & TARGET_SHIP_IGNORE_FLAGS)
&& !(Ships[Objects[transmit_objnum].instance].flags2 & TARGET_SHIP_IGNORE_FLAGS_2) )
{
Transmit_target_current_slot = transmit_index-1;
if ( Transmit_target_current_slot < 0 ) {
Transmit_target_current_slot = MAX_TRANSMIT_TARGETS - 1;
+7 -14
View File
@@ -9,15 +9,15 @@
/*
* $Logfile: /Freespace2/code/Network/MultiMsgs.cpp $
* $Revision: 2.59 $
* $Date: 2006-06-07 18:47:51 $
* $Author: karajorma $
* $Revision: 2.60 $
* $Date: 2006-07-09 01:55:41 $
* $Author: Goober5000 $
*
* C file that holds functions for the building and processing of multiplayer packets
*
* $Log: not supported by cvs2svn $
* Revision 2.58 2006/06/07 04:49:20 wmcoolmon
* Pass to get any files that I missed
* Revision 2.59 2006/06/07 18:47:51 karajorma
* Fix 130 ships limit for Inferno builds
*
* Revision 2.57 2006/06/02 09:10:01 karajorma
* Added the VARIABLE_UPDATE packet to send sexp variable value changes to client machines.
@@ -3315,7 +3315,7 @@ void process_wing_create_packet( ubyte *data, header *hinfo )
}
// packet indicating a ship is departing
void send_ship_depart_packet( object *objp, bool for_reals )
void send_ship_depart_packet( object *objp )
{
ubyte data[MAX_PACKET_SIZE];
int packet_size;
@@ -3325,10 +3325,6 @@ void send_ship_depart_packet( object *objp, bool for_reals )
BUILD_HEADER(SHIP_DEPART);
ADD_USHORT( signature );
if(for_reals)
ADD_USHORT(1);
else
ADD_USHORT(0);
multi_io_send_to_all_reliable(data, packet_size);
}
@@ -3339,11 +3335,9 @@ void process_ship_depart_packet( ubyte *data, header *hinfo )
int offset;
object *objp;
ushort signature;
ushort for_reals;
offset = HEADER_LENGTH;
GET_USHORT( signature );
GET_USHORT( for_reals );
PACKET_SET_SIZE();
// find the object which is departing
@@ -3354,7 +3348,7 @@ void process_ship_depart_packet( ubyte *data, header *hinfo )
}
// start warping him out
shipfx_warpout_start( objp, for_reals );
shipfx_warpout_start( objp );
}
// packet to tell clients cargo of a ship was revealed to all
@@ -7025,7 +7019,6 @@ void process_player_stats_block_packet(ubyte *data, header *hinfo)
int offset = HEADER_LENGTH;
ushort u_tmp;
int i_tmp;
short si_offset;
// nprintf(("Network","----------++++++++++********RECEIVED STATS***********+++++++++----------\n"));
+6 -6
View File
@@ -9,15 +9,15 @@
/*
* $Logfile: /Freespace2/code/Network/multimsgs.h $
* $Revision: 2.11 $
* $Date: 2006-06-07 18:47:51 $
* $Author: karajorma $
* $Revision: 2.12 $
* $Date: 2006-07-09 01:55:41 $
* $Author: Goober5000 $
*
* Header file for the building and sending of multiplayer packets
*
* $Log: not supported by cvs2svn $
* Revision 2.10 2006/06/07 04:49:20 wmcoolmon
* Pass to get any files that I missed
* Revision 2.11 2006/06/07 18:47:51 karajorma
* Fix 130 ships limit for Inferno builds
*
* Revision 2.9 2006/06/02 09:10:02 karajorma
* Added the VARIABLE_UPDATE packet to send sexp variable value changes to client machines.
@@ -529,7 +529,7 @@ void send_wing_create_packet( wing *wingp, int num_to_create, int pre_create_cou
void send_ship_create_packet( object *objp, int is_support = 0 );
// packet indicating a ship is departing
void send_ship_depart_packet( object *objp, bool for_reals );
void send_ship_depart_packet( object *objp );
// send a mission log item packet
void send_mission_log_packet( int entry );
+13 -9
View File
@@ -9,13 +9,16 @@
/*
* $Logfile: /Freespace2/code/Object/CollideShipShip.cpp $
* $Revision: 2.18 $
* $Date: 2006-06-07 04:42:22 $
* $Author: wmcoolmon $
* $Revision: 2.19 $
* $Date: 2006-07-09 01:55:41 $
* $Author: Goober5000 $
*
* Routines to detect collisions and do physics, damage, etc for ships and ships
*
* $Log: not supported by cvs2svn $
* Revision 2.18 2006/06/07 04:42:22 wmcoolmon
* Limbo flag support; further scripting 3.6.9 update
*
* Revision 2.17 2005/12/29 08:08:39 wmcoolmon
* Codebase commit, most notably including objecttypes.tbl
*
@@ -698,11 +701,12 @@ int ship_ship_check_collision(collision_info_struct *ship_ship_hit_info, vec3d *
}
// Make ships that are warping in not get collision detection done
if ( Ships[num].flags & SF_ARRIVING )
return 0;
// WMC - We don't need collision to LIMBO!
// if ( Ships[num].flags & SF_ARRIVING ) return 0;
if ( Ships[num].flags & (SF_ARRIVING_STAGE_1|SF_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) ) {
@@ -1855,9 +1859,9 @@ int collide_ship_ship( obj_pair * pair )
sif_a_flags = Ship_info[Ships[A->instance].ship_info_index].flags;
sif_b_flags = Ship_info[Ships[B->instance].ship_info_index].flags;
// if ship is huge and warping in or out
if ( (Ships[A->instance].flags & (SF_ARRIVING_STAGE_1 | SF_LIMBO)) && (sif_a_flags & (SIF_HUGE_SHIP))
||(Ships[B->instance].flags & (SF_ARRIVING_STAGE_1 | SF_LIMBO)) && (sif_b_flags & (SIF_HUGE_SHIP)) ) {
// 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)) ) {
pair->next_check_time = timestamp(0); // check next time
return 0;
}
+12 -4
View File
@@ -9,13 +9,16 @@
/*
* $Logfile: /Freespace2/code/Object/CollideShipWeapon.cpp $
* $Revision: 2.29 $
* $Date: 2006-06-07 04:42:22 $
* $Author: wmcoolmon $
* $Revision: 2.30 $
* $Date: 2006-07-09 01:55:41 $
* $Author: Goober5000 $
*
* Routines to detect collisions and do physics, damage, etc for weapons and ships
*
* $Log: not supported by cvs2svn $
* Revision 2.29 2006/06/07 04:42:22 wmcoolmon
* Limbo flag support; further scripting 3.6.9 update
*
* Revision 2.28 2006/06/07 03:51:38 wmcoolmon
* Scripting system prep for 3.6.9
*
@@ -399,7 +402,12 @@ int ship_weapon_check_collision(object * ship_obj, object * weapon_obj, float ti
Assert( shipp->objnum == OBJ_INDEX(ship_obj));
// Make ships that are warping in not get collision detection done
if ( shipp->flags & (SF_ARRIVING|SF_LIMBO) ) return 0;
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.
+6 -4
View File
@@ -3164,12 +3164,12 @@ LUA_VAR(IsInLimbo, l_Ship, "Boolean", "Ship's limbo status")
if(LUA_SETTING_VAR)
{
if(newlimbo)
shipp->flags |= SF_LIMBO;
shipp->flags2 |= SF2_IN_LIMBO;
else
shipp->flags &= ~SF_LIMBO;
shipp->flags2 &= ~SF2_IN_LIMBO;
}
return lua_set_args(L, "b", (shipp->flags & SF_LIMBO) != 0);
return lua_set_args(L, "b", (shipp->flags2 & SF2_IN_LIMBO) != 0);
}
LUA_VAR(PrimaryBanks, l_Ship, "weaponbanktype", "Array of primary weapon banks")
@@ -3465,7 +3465,9 @@ LUA_FUNC(warpOut, l_Ship, "[boolean Departing]", "True", "Warps ship out; argume
if(!objh->IsValid())
return LUA_RETURN_NIL;
shipfx_warpout_start(objh->objp, b);
if (!b)
Ships[objh->objp->instance].flags2 |= SF2_DEPART_TO_LIMBO;
shipfx_warpout_start(objh->objp);
return LUA_RETURN_TRUE;
}
+12 -5
View File
@@ -9,13 +9,16 @@
/*
* $Logfile: /Freespace2/code/Radar/Radar.cpp $
* $Revision: 2.23 $
* $Date: 2006-06-07 04:44:57 $
* $Author: wmcoolmon $
* $Revision: 2.24 $
* $Date: 2006-07-09 01:55:41 $
* $Author: Goober5000 $
*
* C module containg functions to display and manage the radar
*
* $Log: not supported by cvs2svn $
* Revision 2.23 2006/06/07 04:44:57 wmcoolmon
* Limbo flag support
*
* Revision 2.22 2006/01/16 11:02:23 wmcoolmon
* Various warning fixes, scripting globals fix; added "plr" and "slf" global variables for in-game hooks; various lua functions; GCC fixes for scripting.
*
@@ -411,8 +414,10 @@ void radar_plot_object_std( object *objp )
// 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].flags & SF_LIMBO)
if (Ships[objp->instance].flags2 & SF2_IN_LIMBO) {
return;
}
break;
case OBJ_JUMP_NODE:
@@ -431,8 +436,10 @@ void radar_plot_object_std( object *objp )
}
//if a local ssm is in subspace, return
if (Weapons[objp->instance].lssm_stage==3)
if (Weapons[objp->instance].lssm_stage == 3) {
return;
}
break;
}
+12 -5
View File
@@ -9,13 +9,16 @@
/*
* $Logfile: /Freespace2/code/Radar/Radarorb.cpp $
* $Revision: 1.24 $
* $Date: 2006-06-07 04:44:57 $
* $Author: wmcoolmon $
* $Revision: 1.25 $
* $Date: 2006-07-09 01:55:41 $
* $Author: Goober5000 $
*
* C module containg functions to display and manage the "orb" radar mode
*
* $Log: not supported by cvs2svn $
* Revision 1.24 2006/06/07 04:44:57 wmcoolmon
* Limbo flag support
*
* Revision 1.23 2006/04/12 22:23:41 taylor
* compiler warning fixes to make GCC 4.1 shut the hell up
*
@@ -323,8 +326,10 @@ void radar_plot_object_orb( object *objp )
// 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].flags & SF_LIMBO)
if (Ships[objp->instance].flags2 & SF2_IN_LIMBO) {
return;
}
break;
case OBJ_JUMP_NODE:
@@ -343,8 +348,10 @@ void radar_plot_object_orb( object *objp )
}
//if a local ssm is in subspace, return
if (Weapons[objp->instance].lssm_stage==3)
if (Weapons[objp->instance].lssm_stage == 3) {
return;
}
break;
}
+22 -5
View File
@@ -9,13 +9,22 @@
/*
* $Logfile: /Freespace2/code/Ship/AWACS.cpp $
* $Revision: 2.28 $
* $Date: 2006-07-06 22:00:39 $
* $Author: taylor $
* $Revision: 2.29 $
* $Date: 2006-07-09 01:55:41 $
* $Author: Goober5000 $
*
* all sorts of cool stuff about ships
*
* $Log: not supported by cvs2svn $
* Revision 2.28 2006/07/06 22:00:39 taylor
* rest of the map/glow changes
* - put glowmap activity back on a per-ship basis (via a SF2_* flag) rather than per-model
* - same for glowpoints, back on a per-ship basis
* - put specmaps and bumpmap back on a LOD0 and LOD1 affect (got changed to LOD0 only recently)
* - fix glowmaps for shockwaves again
* - add support for animated specmaps (mainly for TBP and Starfox mods)
* some minor code cleanup and compiler warning fixes
*
* Revision 2.27 2006/06/27 05:05:18 taylor
* make sure we only do ship related setup on actual ships
*
@@ -299,7 +308,11 @@ void awacs_update_all_levels()
shipp = &Ships[Objects[moveup->objnum].instance];
// ignore dying, departing, or arriving ships
if ((shipp->flags & SF_DYING) || (shipp->flags & SF_DEPARTING) || (shipp->flags & SF_ARRIVING) || (shipp->flags & SF_LIMBO))
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
@@ -545,7 +558,11 @@ void team_visibility_update()
shipp = &Ships[ship_num];
// ignore dying, departing, or arriving ships
if ((shipp->flags & SF_DYING) || (shipp->flags & SF_DEPARTING) || (shipp->flags & SF_ARRIVING) || (shipp->flags & SF_LIMBO))
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
+18 -16
View File
@@ -10,13 +10,17 @@
/*
* $Logfile: /Freespace2/code/Ship/Ship.cpp $
* $Revision: 2.351 $
* $Date: 2006-07-08 04:53:29 $
* $Revision: 2.352 $
* $Date: 2006-07-09 01:55:41 $
* $Author: Goober5000 $
*
* Ship (and other object) handling functions
*
* $Log: not supported by cvs2svn $
* Revision 2.351 2006/07/08 04:53:29 Goober5000
* fix for Mantis #967
* --Goober5000
*
* Revision 2.350 2006/07/06 22:00:39 taylor
* rest of the map/glow changes
* - put glowmap activity back on a per-ship basis (via a SF2_* flag) rather than per-model
@@ -5861,9 +5865,8 @@ void ship_render(object * obj)
// Make ships that are warping in not render during stage 1
//WMC - Or limbo.
if (!(shipp->flags & (SF_ARRIVING_STAGE_1|SF_LIMBO)))
if (!(shipp->flags & SF_ARRIVING_STAGE_1) && !(shipp->flags2 & SF2_IN_LIMBO))
{
if ( Ship_shadows && shipfx_in_shadow( obj ) ) {
light_set_shadow(1);
} else {
@@ -6638,7 +6641,7 @@ void ship_vanished(object *objp)
// demo recording
if(Game_mode & GM_DEMO_RECORD){
demo_POST_departed(objp->signature, sp->flags, true);
demo_POST_departed(objp->signature, sp->flags);
}
// add the information to the exited ship list
@@ -6663,15 +6666,15 @@ void ship_vanished(object *objp)
}
}
void ship_departed( int num, bool for_reals )
void ship_departed( int num )
{
ship *sp;
sp = &Ships[num];
// demo recording
if(Game_mode & GM_DEMO_RECORD){
demo_POST_departed(Objects[Ships[num].objnum].signature, Ships[num].flags, for_reals ? 1 : 0);
if(Game_mode & GM_DEMO_RECORD) {
demo_POST_departed(Objects[Ships[num].objnum].signature, Ships[num].flags);
}
// add the information to the exited ship list
@@ -6685,15 +6688,16 @@ void ship_departed( int num, bool for_reals )
// see if this ship departed within the radius of a jump node -- if so, put the node name into
// the secondary mission log field
jump_node *jnp = jumpnode_get_which_in(&Objects[sp->objnum]);
if(jnp)
if (jnp)
mission_log_add_entry(LOG_SHIP_DEPARTED, sp->ship_name, jnp->get_name_ptr(), sp->wingnum);
else
mission_log_add_entry(LOG_SHIP_DEPARTED, sp->ship_name, NULL, sp->wingnum);
if(!for_reals)
if (sp->flags2 & SF2_DEPART_TO_LIMBO)
{
sp->flags &= ~(SF_DEPARTING);
sp->flags |= SF_LIMBO;
sp->flags &= ~SF_DEPARTING;
sp->flags2 &= ~SF2_DEPART_TO_LIMBO;
sp->flags2 |= SF2_IN_LIMBO;
return;
}
@@ -7912,10 +7916,8 @@ void ship_process_post(object * obj, float frametime)
//Nothing at all.
//
//>_>
if(shipp->flags & SF_LIMBO)
{
if (shipp->flags2 & SF2_IN_LIMBO)
return;
}
update_ets(obj, frametime);
@@ -14775,7 +14777,7 @@ int ship_get_random_targetable_ship()
continue;
// skip if we aren't supposed to target it
if ( Ships[Objects[so->objnum].instance].flags & TARGET_SHIP_IGNORE_FLAGS )
if ( (Ships[Objects[so->objnum].instance].flags & TARGET_SHIP_IGNORE_FLAGS) || (Ships[Objects[so->objnum].instance].flags2 & TARGET_SHIP_IGNORE_FLAGS_2) )
continue;
if (idx >= MAX_SHIPS) {
+12 -8
View File
@@ -9,13 +9,18 @@
/*
* $Logfile: /Freespace2/code/Ship/Ship.h $
* $Revision: 2.160 $
* $Date: 2006-07-07 01:45:57 $
* $Revision: 2.161 $
* $Date: 2006-07-09 01:55:41 $
* $Author: Goober5000 $
*
* all sorts of cool stuff about ships
*
* $Log: not supported by cvs2svn $
* Revision 2.160 2006/07/07 01:45:57 Goober5000
* fixed something that slipped by taylor ;)
* (caused by having extra flags in the main branch)
* --Goober5000
*
* Revision 2.159 2006/07/06 22:00:39 taylor
* rest of the map/glow changes
* - put glowmap activity back on a per-ship basis (via a SF2_* flag) rather than per-model
@@ -44,9 +49,6 @@
* Revision 2.154 2006/06/07 05:19:49 wmcoolmon
* Move fog disappearance factor to objecttypes.tbl
*
* Revision 2.153 2006/06/07 04:47:43 wmcoolmon
* Limbo flag support; removed unneeded muzzle flash flag
*
* Revision 2.152 2006/06/04 01:01:53 Goober5000
* add fighterbay restriction code
* --Goober5000
@@ -1156,7 +1158,7 @@ typedef struct ship_subsys_info {
#define SF_SHIP_HAS_SCREAMED (1 << 10) // ship has let out a death scream
#define SF_RED_ALERT_STORE_STATUS (1 << 9) // ship status should be stored/restored if red alert mission
#define SF_VAPORIZE (1<<8) // ship is vaporized by beam - alternative death sequence
#define SF_LIMBO (1<<7) //WMC - Ship isn't in mission, but still in Ships array
//#define SF_INVULNERABLE (1 << 7)
// MWA -- don't go below whatever bitfield is used for Fred above (currently 7)!!!!
@@ -1185,9 +1187,12 @@ typedef struct ship_subsys_info {
#define SF2_TEAM_LOADOUT_STORE_STATUS (1<<14) // Karajorma - This ship has been flagged for cleanup at the end of the mission
#define SF2_NO_DEATH_SCREAM (1<<15) // Goober5000 - for WCS
#define SF2_GLOWMAPS_DISABLED (1<<16) // taylor - to disable glow maps
#define SF2_IN_LIMBO (1<<17) // WMC - Ship isn't in mission, but still in Ships array
#define SF2_DEPART_TO_LIMBO (1<<18) // WMC/Goober5000
// If any of these bits in the ship->flags are set, ignore this ship when targetting
extern int TARGET_SHIP_IGNORE_FLAGS;
extern int TARGET_SHIP_IGNORE_FLAGS_2;
#define MAX_DAMAGE_SLOTS 32
#define MAX_SHIP_ARCS 2 // How many "arcs" can be active at once... Must be less than MAX_ARC_EFFECTS in model.h.
@@ -1251,7 +1256,6 @@ typedef struct ship {
int warp_anim_fps;
vec3d warp_effect_pos; // where the warp in effect comes in at
vec3d warp_effect_fvec; // The warp in effect's forward vector
bool warpout_for_reals;
int next_fireball;
int next_hit_spark;
@@ -2183,7 +2187,7 @@ extern int ship_query_state(char *name);
int ship_primary_bank_has_ammo(int shipnum); // check if current primary bank has ammo
int ship_secondary_bank_has_ammo(int shipnum); // check if current secondary bank has ammo
void ship_departed( int num, bool for_reals = true );
void ship_departed( int num );
int ship_engine_ok_to_warp(ship *sp); // check if ship has engine power to warp
int ship_navigation_ok_to_warp(ship *sp); // check if ship has navigation power to warp
+16 -15
View File
@@ -9,13 +9,16 @@
/*
* $Logfile: /Freespace2/code/Ship/ShipFX.cpp $
* $Revision: 2.70 $
* $Date: 2006-07-05 23:35:43 $
* $Revision: 2.71 $
* $Date: 2006-07-09 01:55:41 $
* $Author: Goober5000 $
*
* Routines for ship effects (as in special)
*
* $Log: not supported by cvs2svn $
* Revision 2.70 2006/07/05 23:35:43 Goober5000
* cvs comment tweaks
*
* Revision 2.69 2006/06/15 06:18:35 Goober5000
* make warpout work properly even if the player is docked to something
* --Goober5000
@@ -1053,8 +1056,8 @@ void shipfx_warpin_start( object *objp )
return;
}
if(shipp->flags & SF_LIMBO)
shipp->flags &= (~SF_LIMBO);
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)
@@ -1239,11 +1242,11 @@ void shipfx_warpout_helper(object *objp, dock_function_info *infop)
}
else
{
if(Ships[objp->instance].warpout_for_reals)
if (!(Ships[objp->instance].flags2 & SF2_DEPART_TO_LIMBO))
objp->flags |= OF_SHOULD_BE_DEAD;
if (objp->type == OBJ_SHIP)
ship_departed(objp->instance, Ships[objp->instance].warpout_for_reals);
ship_departed(objp->instance);
}
}
@@ -1426,7 +1429,7 @@ void compute_warpout_stuff(object *objp, float *speed, float *warp_time, vec3d *
// where it flies forward for a set time period at a set
// velocity, then disappears when that time is reached. This
// also starts the animating 3d effect playing.
void shipfx_warpout_start( object *objp, bool for_reals )
void shipfx_warpout_start( object *objp )
{
float warp_time;
ship *shipp;
@@ -1448,9 +1451,6 @@ void shipfx_warpout_start( object *objp, bool for_reals )
return;
}
// if we aren't warping out for reals, set that.
shipp->warpout_for_reals = for_reals;
// if we're HUGE, keep alive - set guardian
if (Ship_info[shipp->ship_info_index].flags & SIF_HUGE_SHIP) {
shipp->ship_guardian_threshold = SHIP_GUARDIAN_THRESHOLD_DEFAULT;
@@ -1463,7 +1463,7 @@ void shipfx_warpout_start( object *objp, bool for_reals )
// don't send ship depart packets for player ships
if ( (MULTIPLAYER_MASTER) && !(objp->flags & OF_PLAYER_SHIP) ){
send_ship_depart_packet( objp, for_reals );
send_ship_depart_packet( objp );
}
// don't do departure wormhole if ship flag is set which indicates no effect
@@ -1578,12 +1578,13 @@ void shipfx_warpout_frame( object *objp, float frametime )
shipp = &Ships[objp->instance];
ship_info *sip = &Ship_info[shipp->ship_info_index];
if ( shipp->flags & SF_DYING ) return;
if (shipp->flags & SF_DYING)
return;
//disabled ships should stay on the battlefield if they were disabled during warpout
//phreak 5/22/03
if (shipp->flags & SF_DISABLED){
shipp->flags &= ~(SF_DEPARTING);
if (shipp->flags & SF_DISABLED) {
shipp->flags &= ~SF_DEPARTING;
return;
}
@@ -1635,7 +1636,7 @@ void shipfx_warpout_frame( object *objp, float frametime )
}
gameseq_post_event( GS_EVENT_PLAYER_WARPOUT_DONE );
ship_departed( objp->instance, Ships[objp->instance].warpout_for_reals ); // mark log entry for the player
ship_departed( objp->instance ); // mark log entry for the player
}
} else {
+4 -4
View File
@@ -9,9 +9,9 @@
/*
* $Logfile: /Freespace2/code/Ship/ShipFX.h $
* $Revision: 2.11 $
* $Date: 2006-06-07 04:47:43 $
* $Author: wmcoolmon $
* $Revision: 2.12 $
* $Date: 2006-07-09 01:55:42 $
* $Author: Goober5000 $
*
* Routines for ship effects (as in special)
*
@@ -201,7 +201,7 @@ extern void shipfx_warpin_start( object *objp );
extern void shipfx_warpin_frame( object *objp, float frametime );
// When a ship warps out, this gets called to start the effect
extern void shipfx_warpout_start( object *objp, bool for_reals = true );
extern void shipfx_warpout_start( object *objp );
// During a ship warp out, this gets called each frame to move the ship
extern void shipfx_warpout_frame( object *objp, float frametime );