Attached Files |
-
2693_sexp_updated.patch (10,910 bytes) 2013-06-03 18:05
Index: ai/aiturret.cpp
===================================================================
--- ai/aiturret.cpp (revision 9691)
+++ ai/aiturret.cpp (working copy)
@@ -479,7 +479,7 @@
}
// don't shoot at ships without collision check
- if (sip->flags & SIF_NO_COLLIDE) {
+ if (shipp->flags2 & SF2_NO_COLLIDE) {
return 0;
}
Index: fred2/fred.rc
===================================================================
--- fred2/fred.rc (revision 9691)
+++ fred2/fred.rc (working copy)
@@ -1830,9 +1830,10 @@
GROUPBOX "Turret Threats",IDC_STATIC,7,83,102,48
CONTROL "Does Not Move",IDC_IMMOBILE,"Button",BS_3STATE | WS_TABSTOP,7,274,66,10
CONTROL "Cloaked",IDC_CLOAKED,"Button",BS_3STATE | WS_TABSTOP,165,167,42,10
+ CONTROL "No Collisions",IDC_NO_COLLIDE,"Button",BS_3STATE | WS_TABSTOP,165,179,66,10
END
-IDD_ADD_VARIABLE DIALOG 0, 0, 422, 102
+IDD_ADD_VARIABLE DIALOG 0, 0, 422, 102
STYLE DS_SETFONT | DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU
CAPTION "Add Variable"
FONT 8, "MS Sans Serif"
Index: fred2/missionsave.cpp
===================================================================
--- fred2/missionsave.cpp (revision 9691)
+++ fred2/missionsave.cpp (working copy)
@@ -1724,6 +1724,8 @@
fout(" \"ship-locked\"");
if (shipp->flags2 & SF2_WEAPONS_LOCKED)
fout(" \"weapons-locked\"");
+ if (shipp->flags2 & SF2_NO_COLLIDE)
+ fout(" \"no-collide\"");
fout(" )");
}
// -----------------------------------------------------------
Index: fred2/resource.h
===================================================================
--- fred2/resource.h (revision 9691)
+++ fred2/resource.h (working copy)
@@ -1170,6 +1170,7 @@
#define IDC_MISSION_LOG_LAST_REPEAT 1640
#define IDC_MISSION_LOG_1ST_TRIGGER 1641
#define IDC_MISSION_LOG_LAST_TRIGGER 1642
+#define IDC_NO_COLLIDE 1643
#define ID_FILE_MISSIONNOTES 32771
#define ID_DUPLICATE 32774
#define ID_VIEW_ROTATE 32775
@@ -1463,7 +1464,7 @@
#define _APS_3D_CONTROLS 1
#define _APS_NEXT_RESOURCE_VALUE 320
#define _APS_NEXT_COMMAND_VALUE 33098
-#define _APS_NEXT_CONTROL_VALUE 1643
+#define _APS_NEXT_CONTROL_VALUE 1644
#define _APS_NEXT_SYMED_VALUE 105
#endif
#endif
Index: fred2/shipflagsdlg.cpp
===================================================================
--- fred2/shipflagsdlg.cpp (revision 9691)
+++ fred2/shipflagsdlg.cpp (working copy)
@@ -74,6 +74,7 @@
DDX_Control(pDX, IDC_HIDE_SHIP_NAME, m_hide_ship_name);
DDX_Control(pDX, IDC_DISABLE_ETS, m_disable_ets);
DDX_Control(pDX, IDC_CLOAKED, m_cloaked);
+ DDX_Control(pDX, IDC_NO_COLLIDE, m_no_collide);
DDX_Control(pDX, IDC_SET_CLASS_DYNAMICALLY, m_set_class_dynamically);
//}}AFX_DATA_MAP
@@ -138,6 +139,7 @@
ON_BN_CLICKED(IDC_SET_CLASS_DYNAMICALLY, OnSetClassDynamically)
ON_BN_CLICKED(IDC_DISABLE_ETS, OnDisableETS)
ON_BN_CLICKED(IDC_CLOAKED, OnCloaked)
+ ON_BN_CLICKED(IDC_NO_COLLIDE, OnNoCollide)
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
@@ -159,7 +161,7 @@
int toggle_subsystem_scanning = 0, scannable = 0, kamikaze = 0, no_dynamic = 0, red_alert_carry = 0;
int special_warpin = 0, disable_messages = 0, guardian = 0, vaporize = 0, stealth = 0, friendly_stealth_invisible = 0;
int no_death_scream = 0, always_death_scream = 0;
- int nav_carry = 0, nav_needslink = 0, hide_ship_name = 0, set_class_dynamically = 0, no_ets = 0, cloaked = 0;
+ int nav_carry = 0, nav_needslink = 0, hide_ship_name = 0, set_class_dynamically = 0, no_ets = 0, cloaked = 0, no_collide = 0;
object *objp;
ship *shipp;
@@ -207,6 +209,7 @@
hide_ship_name = (shipp->flags2 & SF2_HIDE_SHIP_NAME) ? 1 : 0;
no_ets = (shipp->flags2 & SF2_NO_ETS) ? 1 : 0;
cloaked = (shipp->flags2 & SF2_CLOAKED) ? 1 : 0;
+ no_collide = (shipp->flags2 & SF2_NO_COLLIDE) ? 1 : 0;
destroy_before_mission = (shipp->flags & SF_KILL_BEFORE_MISSION) ? 1 : 0;
m_destroy_value.init(shipp->final_death_time);
@@ -266,6 +269,7 @@
hide_ship_name = tristate_set(shipp->flags2 & SF2_HIDE_SHIP_NAME, hide_ship_name);
no_ets = tristate_set(shipp->flags2 & SF2_NO_ETS, no_ets);
cloaked = tristate_set(shipp->flags2 & SF2_CLOAKED, cloaked);
+ no_collide = tristate_set(shipp->flags2 & SF2_NO_COLLIDE, no_collide);
// check the final death time and set the internal variable according to whether or not
// the final_death_time is set. Also, the value in the edit box must be set if all the
@@ -339,6 +343,7 @@
m_hide_ship_name.SetCheck(hide_ship_name);
m_disable_ets.SetCheck(no_ets);
m_cloaked.SetCheck(cloaked);
+ m_no_collide.SetCheck(no_collide);
m_kdamage.setup(IDC_KDAMAGE, this);
m_destroy_value.setup(IDC_DESTROY_VALUE, this);
@@ -956,6 +961,22 @@
break;
}
+ switch (m_no_collide.GetCheck()) {
+ case 1:
+ if ( !(shipp->flags2 & SF2_NO_COLLIDE) )
+ set_modified();
+
+ shipp->flags2 |= SF2_NO_COLLIDE;
+ break;
+
+ case 0:
+ if ( shipp->flags2 & SF2_NO_COLLIDE )
+ set_modified();
+
+ shipp->flags2 &= ~SF2_NO_COLLIDE;
+ break;
+ }
+
switch (m_guardian.GetCheck()) {
case 1:
if ( !(shipp->ship_guardian_threshold) )
@@ -1381,3 +1402,12 @@
m_cloaked.SetCheck(1);
}
}
+
+void ship_flags_dlg::OnNoCollide()
+{
+ if (m_no_collide.GetCheck() == 1) {
+ m_no_collide.SetCheck(0);
+ } else {
+ m_no_collide.SetCheck(1);
+ }
+}
Index: fred2/shipflagsdlg.h
===================================================================
--- fred2/shipflagsdlg.h (revision 9691)
+++ fred2/shipflagsdlg.h (working copy)
@@ -65,6 +65,7 @@
CButton m_hide_ship_name;
CButton m_disable_ets;
CButton m_cloaked;
+ CButton m_no_collide;
CButton m_set_class_dynamically;
CSpinButtonCtrl m_destroy_spin;
numeric_edit_control m_kdamage;
@@ -123,6 +124,7 @@
afx_msg void OnSetClassDynamically();
afx_msg void OnDisableETS();
afx_msg void OnCloaked();
+ afx_msg void OnNoCollide();
//}}AFX_MSG
DECLARE_MESSAGE_MAP()
};
Index: mission/missionparse.cpp
===================================================================
--- mission/missionparse.cpp (revision 9691)
+++ mission/missionparse.cpp (working copy)
@@ -310,6 +310,7 @@
"cloaked",
"ship-locked",
"weapons-locked",
+ "no-collide",
};
char *Mission_event_log_flags[MAX_MISSION_EVENT_LOG_FLAGS] = {
@@ -2556,6 +2557,9 @@
if (parse_flags2 & P2_SF2_WEAPONS_LOCKED)
shipp->flags2 |= SF2_WEAPONS_LOCKED;
+
+ if (parse_flags2 & P2_SF2_NO_COLLIDE)
+ shipp->flags2 |= SF2_NO_COLLIDE;
}
void fix_old_special_explosions(p_object *p_objp, int variable_index)
Index: mission/missionparse.h
===================================================================
--- mission/missionparse.h (revision 9691)
+++ mission/missionparse.h (working copy)
@@ -591,7 +591,7 @@
// same caveat: This list of bitfield indicators MUST correspond EXACTLY
// (i.e., order and position must be the same) to its counterpart in MissionParse.cpp!!!!
-#define MAX_PARSE_OBJECT_FLAGS_2 22
+#define MAX_PARSE_OBJECT_FLAGS_2 23
#define P2_SF2_PRIMITIVE_SENSORS (1<<0)
#define P2_SF2_NO_SUBSPACE_DRIVE (1<<1)
@@ -615,6 +615,7 @@
#define P2_SF2_CLOAKED (1<<19)
#define P2_SF2_SHIP_LOCKED (1<<20)
#define P2_SF2_WEAPONS_LOCKED (1<<21)
+#define P2_SF2_NO_COLLIDE (1<<22)
// and again: these flags do not appear in the array
//#define blah (1<<29)
Index: object/collideshipship.cpp
===================================================================
--- object/collideshipship.cpp (revision 9691)
+++ object/collideshipship.cpp (working copy)
@@ -172,11 +172,11 @@
}
// If either of these objects doesn't get collision checks, abort.
- if (heavy_sip->flags & SIF_NO_COLLIDE) {
+ if (heavy_shipp->flags2 & SF2_NO_COLLIDE) {
return 0;
}
- if (light_sip->flags & SIF_NO_COLLIDE) {
+ if (light_shipp->flags2 & SF2_NO_COLLIDE) {
return 0;
}
Index: object/collideshipweapon.cpp
===================================================================
--- object/collideshipweapon.cpp (revision 9691)
+++ object/collideshipweapon.cpp (working copy)
@@ -142,7 +142,7 @@
if ( shipp->flags & SF_ARRIVING ) return 0;
// If either of these objects doesn't get collision checks, abort.
- if (Ship_info[shipp->ship_info_index].flags & SIF_NO_COLLIDE)
+ if ( shipp->flags2 & SF2_NO_COLLIDE )
return 0;
// Return information for AI to detect incoming fire.
Index: ship/ship.cpp
===================================================================
--- ship/ship.cpp (revision 9691)
+++ ship/ship.cpp (working copy)
@@ -372,6 +372,7 @@
{SF2_NO_SUBSPACE_DRIVE, "no-subspace-drive", 2, },
{SF2_DONT_COLLIDE_INVIS, "don't-collide-invisible", 2, },
{SF2_NO_ETS, "no-ets", 2, },
+ {SF2_NO_COLLIDE, "no-collide", 2, }
};
const int num_ai_tgt_weapon_flags = sizeof(ai_tgt_weapon_flags) / sizeof(flag_def_list);
@@ -4773,6 +4774,8 @@
shipp->flags2 |= SF2_STEALTH;
if (sip->flags & SIF_SHIP_CLASS_DONT_COLLIDE_INVIS)
shipp->flags2 |= SF2_DONT_COLLIDE_INVIS;
+ if (sip->flags & SIF_NO_COLLIDE)
+ shipp->flags2 |= SF2_NO_COLLIDE;
if (sip->flags2 & SIF2_NO_ETS)
shipp->flags2 |= SF2_NO_ETS;
@@ -9247,6 +9250,11 @@
else if (sip_orig->flags & SIF_SHIP_CLASS_DONT_COLLIDE_INVIS) // changing FROM a don't-collide-invisible ship class
sp->flags2 &= ~SF2_DONT_COLLIDE_INVIS;
+ if (sip->flags & SIF_NO_COLLIDE) // changing TO a no-collision ship class
+ sp->flags2 |= SF2_NO_COLLIDE;
+ else if (sip_orig->flags & SIF_NO_COLLIDE) // changing FROM a no-collision ship class
+ sp->flags2 &= ~SF2_NO_COLLIDE;
+
if (sip->flags2 & SIF2_NO_ETS)
sp->flags2 |= SF2_NO_ETS;
else if (sip_orig->flags2 & SIF2_NO_ETS)
Index: ship/ship.h
===================================================================
--- ship/ship.h (revision 9691)
+++ ship/ship.h (working copy)
@@ -416,7 +416,7 @@
int flag_list; // is this flag in the 1st or 2nd ship flags list?
} ship_flag_name;
-#define MAX_SHIP_FLAG_NAMES 9
+#define MAX_SHIP_FLAG_NAMES 10
extern ship_flag_name Ship_flag_names[];
// states for the flags variable within the ship structure
@@ -496,6 +496,7 @@
#define SF2_SHIP_LOCKED (1<<24) // Karajorma - Prevents the player from changing the ship class on loadout screen
#define SF2_WEAPONS_LOCKED (1<<25) // Karajorma - Prevents the player from changing the weapons on the ship on the loadout screen
#define SF2_SHIP_SELECTIVE_LINKING (1<<26) // RSAXVC - Allow pilot to pick firing configuration
+#define SF2_NO_COLLIDE (1<<27) // FUBAR - Removes the ship from collision checks
// If any of these bits in the ship->flags are set, ignore this ship when targeting
extern int TARGET_SHIP_IGNORE_FLAGS;
-
2887_updated.diff (10,957 bytes) 2014-07-09 18:11
Index: ai/aiturret.cpp
===================================================================
--- ai/aiturret.cpp (revision 10907)
+++ ai/aiturret.cpp (working copy)
@@ -479,7 +479,7 @@
}
// don't shoot at ships without collision check
- if (sip->flags & SIF_NO_COLLIDE) {
+ if (shipp->flags2 & SF2_NO_COLLIDE) {
return 0;
}
Index: fred2/fred.rc
===================================================================
--- fred2/fred.rc (revision 10907)
+++ fred2/fred.rc (working copy)
@@ -1837,6 +1837,7 @@
CONTROL "Does Not Move",IDC_IMMOBILE,"Button",BS_3STATE | WS_TABSTOP,7,274,66,10
CONTROL "Cloaked",IDC_CLOAKED,"Button",BS_3STATE | WS_TABSTOP,165,167,42,10
CONTROL "Scramble Messages",IDC_SCRAMBLE_MESSAGES,"Button",BS_3STATE | WS_TABSTOP,165,177,79,10
+ CONTROL "No Collisions",IDC_NO_COLLIDE,"Button",BS_3STATE | WS_TABSTOP,165,179,66,10
END
IDD_ADD_VARIABLE DIALOG 0, 0, 422, 102
Index: fred2/missionsave.cpp
===================================================================
--- fred2/missionsave.cpp (revision 10907)
+++ fred2/missionsave.cpp (working copy)
@@ -1742,6 +1742,8 @@
fout(" \"weapons-locked\"");
if (shipp->flags2 & SF2_SCRAMBLE_MESSAGES)
fout(" \"scramble-messages\"");
+ if (shipp->flags2 & SF2_NO_COLLIDE)
+ fout(" \"no-collide\"");
fout(" )");
}
// -----------------------------------------------------------
Index: fred2/resource.h
===================================================================
--- fred2/resource.h (revision 10907)
+++ fred2/resource.h (working copy)
@@ -1179,6 +1179,7 @@
#define IDC_MISSION_LOG_LAST_REPEAT 1640
#define IDC_MISSION_LOG_1ST_TRIGGER 1641
#define IDC_MISSION_LOG_LAST_TRIGGER 1642
+#define IDC_NO_COLLIDE 1643
#define ID_FILE_MISSIONNOTES 32771
#define ID_DUPLICATE 32774
#define ID_VIEW_ROTATE 32775
@@ -1471,7 +1472,7 @@
#define _APS_3D_CONTROLS 1
#define _APS_NEXT_RESOURCE_VALUE 320
#define _APS_NEXT_COMMAND_VALUE 33098
-#define _APS_NEXT_CONTROL_VALUE 1643
+#define _APS_NEXT_CONTROL_VALUE 1644
#define _APS_NEXT_SYMED_VALUE 105
#endif
#endif
Index: fred2/shipflagsdlg.cpp
===================================================================
--- fred2/shipflagsdlg.cpp (revision 10907)
+++ fred2/shipflagsdlg.cpp (working copy)
@@ -74,6 +74,7 @@
DDX_Control(pDX, IDC_HIDE_SHIP_NAME, m_hide_ship_name);
DDX_Control(pDX, IDC_DISABLE_ETS, m_disable_ets);
DDX_Control(pDX, IDC_CLOAKED, m_cloaked);
+ DDX_Control(pDX, IDC_NO_COLLIDE, m_no_collide);
DDX_Control(pDX, IDC_SET_CLASS_DYNAMICALLY, m_set_class_dynamically);
DDX_Control(pDX, IDC_SCRAMBLE_MESSAGES, m_scramble_messages);
//}}AFX_DATA_MAP
@@ -140,6 +141,7 @@
ON_BN_CLICKED(IDC_DISABLE_ETS, OnDisableETS)
ON_BN_CLICKED(IDC_CLOAKED, OnCloaked)
ON_BN_CLICKED(IDC_SCRAMBLE_MESSAGES, OnScrambleMessages)
+ ON_BN_CLICKED(IDC_NO_COLLIDE, OnNoCollide)
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
@@ -161,7 +163,7 @@
int toggle_subsystem_scanning = 0, scannable = 0, kamikaze = 0, no_dynamic = 0, red_alert_carry = 0;
int special_warpin = 0, disable_messages = 0, guardian = 0, vaporize = 0, stealth = 0, friendly_stealth_invisible = 0;
int no_death_scream = 0, always_death_scream = 0, scramble_messages = 0;
- int nav_carry = 0, nav_needslink = 0, hide_ship_name = 0, set_class_dynamically = 0, no_ets = 0, cloaked = 0;
+ int nav_carry = 0, nav_needslink = 0, hide_ship_name = 0, set_class_dynamically = 0, no_ets = 0, cloaked = 0, no_collide = 0;
object *objp;
ship *shipp;
@@ -210,6 +212,7 @@
no_ets = (shipp->flags2 & SF2_NO_ETS) ? 1 : 0;
cloaked = (shipp->flags2 & SF2_CLOAKED) ? 1 : 0;
scramble_messages = (shipp->flags2 & SF2_SCRAMBLE_MESSAGES) ? 1 : 0;
+ no_collide = (shipp->flags2 & SF2_NO_COLLIDE) ? 1 : 0;
destroy_before_mission = (shipp->flags & SF_KILL_BEFORE_MISSION) ? 1 : 0;
m_destroy_value.init(shipp->final_death_time);
@@ -270,6 +273,7 @@
no_ets = tristate_set(shipp->flags2 & SF2_NO_ETS, no_ets);
cloaked = tristate_set(shipp->flags2 & SF2_CLOAKED, cloaked);
scramble_messages = tristate_set(shipp->flags2 & SF2_SCRAMBLE_MESSAGES, scramble_messages);
+ no_collide = tristate_set(shipp->flags2 & SF2_NO_COLLIDE, no_collide);
// check the final death time and set the internal variable according to whether or not
// the final_death_time is set. Also, the value in the edit box must be set if all the
@@ -344,6 +348,7 @@
m_disable_ets.SetCheck(no_ets);
m_cloaked.SetCheck(cloaked);
m_scramble_messages.SetCheck(scramble_messages);
+ m_no_collide.SetCheck(no_collide);
m_kdamage.setup(IDC_KDAMAGE, this);
m_destroy_value.setup(IDC_DESTROY_VALUE, this);
@@ -961,6 +966,22 @@
break;
}
+ switch (m_no_collide.GetCheck()) {
+ case 1:
+ if ( !(shipp->flags2 & SF2_NO_COLLIDE) )
+ set_modified();
+
+ shipp->flags2 |= SF2_NO_COLLIDE;
+ break;
+
+ case 0:
+ if ( shipp->flags2 & SF2_NO_COLLIDE )
+ set_modified();
+
+ shipp->flags2 &= ~SF2_NO_COLLIDE;
+ break;
+ }
+
switch (m_guardian.GetCheck()) {
case 1:
if ( !(shipp->ship_guardian_threshold) )
@@ -1410,3 +1431,12 @@
m_scramble_messages.SetCheck(1);
}
}
+
+void ship_flags_dlg::OnNoCollide()
+{
+ if (m_no_collide.GetCheck() == 1) {
+ m_no_collide.SetCheck(0);
+ } else {
+ m_no_collide.SetCheck(1);
+ }
+}
Index: fred2/shipflagsdlg.h
===================================================================
--- fred2/shipflagsdlg.h (revision 10907)
+++ fred2/shipflagsdlg.h (working copy)
@@ -65,6 +65,7 @@
CButton m_hide_ship_name;
CButton m_disable_ets;
CButton m_cloaked;
+ CButton m_no_collide;
CButton m_set_class_dynamically;
CButton m_scramble_messages;
@@ -126,6 +127,7 @@
afx_msg void OnDisableETS();
afx_msg void OnCloaked();
afx_msg void OnScrambleMessages();
+ afx_msg void OnNoCollide();
//}}AFX_MSG
DECLARE_MESSAGE_MAP()
};
Index: mission/missionparse.cpp
===================================================================
--- mission/missionparse.cpp (revision 10907)
+++ mission/missionparse.cpp (working copy)
@@ -311,6 +311,7 @@
"ship-locked",
"weapons-locked",
"scramble-messages",
+ "no-collide",
};
char *Mission_event_log_flags[MAX_MISSION_EVENT_LOG_FLAGS] = {
@@ -2582,6 +2583,9 @@
if (parse_flags2 & P2_SF2_SCRAMBLE_MESSAGES)
shipp->flags2 |= SF2_SCRAMBLE_MESSAGES;
+
+ if (parse_flags2 & P2_SF2_NO_COLLIDE)
+ shipp->flags2 |= SF2_NO_COLLIDE;
}
void fix_old_special_explosions(p_object *p_objp, int variable_index)
Index: mission/missionparse.h
===================================================================
--- mission/missionparse.h (revision 10907)
+++ mission/missionparse.h (working copy)
@@ -487,7 +487,7 @@
// same caveat: This list of bitfield indicators MUST correspond EXACTLY
// (i.e., order and position must be the same) to its counterpart in MissionParse.cpp!!!!
-#define MAX_PARSE_OBJECT_FLAGS_2 23
+#define MAX_PARSE_OBJECT_FLAGS_2 24
#define P2_SF2_PRIMITIVE_SENSORS (1<<0)
#define P2_SF2_NO_SUBSPACE_DRIVE (1<<1)
@@ -512,6 +512,7 @@
#define P2_SF2_SHIP_LOCKED (1<<20)
#define P2_SF2_WEAPONS_LOCKED (1<<21)
#define P2_SF2_SCRAMBLE_MESSAGES (1<<22)
+#define P2_SF2_NO_COLLIDE (1<<23)
// and again: these flags do not appear in the array
//#define blah (1<<28)
Index: object/collideshipship.cpp
===================================================================
--- object/collideshipship.cpp (revision 10907)
+++ object/collideshipship.cpp (working copy)
@@ -173,11 +173,11 @@
}
// If either of these objects doesn't get collision checks, abort.
- if (heavy_sip->flags & SIF_NO_COLLIDE) {
+ if (heavy_shipp->flags2 & SF2_NO_COLLIDE) {
return 0;
}
- if (light_sip->flags & SIF_NO_COLLIDE) {
+ if (light_shipp->flags2 & SF2_NO_COLLIDE) {
return 0;
}
Index: object/collideshipweapon.cpp
===================================================================
--- object/collideshipweapon.cpp (revision 10907)
+++ object/collideshipweapon.cpp (working copy)
@@ -142,7 +142,7 @@
if ( shipp->flags & SF_ARRIVING ) return 0;
// If either of these objects doesn't get collision checks, abort.
- if (Ship_info[shipp->ship_info_index].flags & SIF_NO_COLLIDE)
+ if ( shipp->flags2 & SF2_NO_COLLIDE )
return 0;
// Return information for AI to detect incoming fire.
Index: ship/ship.cpp
===================================================================
--- ship/ship.cpp (revision 10907)
+++ ship/ship.cpp (working copy)
@@ -382,6 +382,7 @@
{SF2_DONT_COLLIDE_INVIS, "don't-collide-invisible", 2, },
{SF2_NO_ETS, "no-ets", 2, },
{SF2_TOGGLE_SUBSYSTEM_SCANNING, "toggle-subsystem-scanning", 2, },
+ {SF2_NO_COLLIDE, "no-collide", 2, },
};
const int num_ai_tgt_weapon_flags = sizeof(ai_tgt_weapon_flags) / sizeof(flag_def_list);
@@ -4882,6 +4883,8 @@
wing_status_wing_index = -1;
wing_status_wing_pos = -1;
+ if (sip->flags & SIF_NO_COLLIDE)
+ shipp->flags2 |= SF2_NO_COLLIDE;
alt_type_index = -1;
callsign_index = -1;
@@ -9537,10 +9540,10 @@
else if (sip_orig->flags & SIF_SHIP_CLASS_DONT_COLLIDE_INVIS) // changing FROM a don't-collide-invisible ship class
sp->flags2 &= ~SF2_DONT_COLLIDE_INVIS;
- if (sip->flags & SIF_NO_COLLIDE) // changing TO a no_collide ship
- Objects[sp->objnum].flags &= ~OF_COLLIDES;
- else if (sip_orig->flags & SIF_NO_COLLIDE) // changing FROM a no_collide ship
- Objects[sp->objnum].flags |= OF_COLLIDES;
+ if (sip->flags & SIF_NO_COLLIDE) // changing TO a no-collision ship class
+ sp->flags2 |= SF2_NO_COLLIDE;
+ else if (sip_orig->flags & SIF_NO_COLLIDE) // changing FROM a no-collision ship class
+ sp->flags2 &= ~SF2_NO_COLLIDE;
if (sip->flags2 & SIF2_NO_ETS)
sp->flags2 |= SF2_NO_ETS;
Index: ship/ship.h
===================================================================
--- ship/ship.h (revision 10907)
+++ ship/ship.h (working copy)
@@ -424,7 +424,7 @@
int flag_list; // is this flag in the 1st or 2nd ship flags list?
} ship_flag_name;
-#define MAX_SHIP_FLAG_NAMES 17
+#define MAX_SHIP_FLAG_NAMES 18
extern ship_flag_name Ship_flag_names[];
// states for the flags variable within the ship structure
@@ -505,6 +505,7 @@
#define SF2_WEAPONS_LOCKED (1<<25) // Karajorma - Prevents the player from changing the weapons on the ship on the loadout screen
#define SF2_SHIP_SELECTIVE_LINKING (1<<26) // RSAXVC - Allow pilot to pick firing configuration
#define SF2_SCRAMBLE_MESSAGES (1<<27) // Goober5000 - all messages sent from this ship appear scrambled
+#define SF2_NO_COLLIDE (1<<28) // FUBAR - Removes the ship from collision checks
// If any of these bits in the ship->flags are set, ignore this ship when targeting
extern int TARGET_SHIP_IGNORE_FLAGS;
-
2887_updated2.diff (11,007 bytes) 2014-07-26 05:33
Index: code/ai/aiturret.cpp
===================================================================
--- code/ai/aiturret.cpp (revision 10946)
+++ code/ai/aiturret.cpp (working copy)
@@ -479,7 +479,7 @@
}
// don't shoot at ships without collision check
- if (sip->flags & SIF_NO_COLLIDE) {
+ if (shipp->flags2 & SF2_NO_COLLIDE) {
return 0;
}
Index: code/fred2/fred.rc
===================================================================
--- code/fred2/fred.rc (revision 10946)
+++ code/fred2/fred.rc (working copy)
@@ -1837,6 +1837,7 @@
CONTROL "Does Not Move",IDC_IMMOBILE,"Button",BS_3STATE | WS_TABSTOP,7,274,66,10
CONTROL "Cloaked",IDC_CLOAKED,"Button",BS_3STATE | WS_TABSTOP,165,167,42,10
CONTROL "Scramble Messages",IDC_SCRAMBLE_MESSAGES,"Button",BS_3STATE | WS_TABSTOP,165,177,79,10
+ CONTROL "No Collisions",IDC_NO_COLLIDE,"Button",BS_3STATE | WS_TABSTOP,165,179,66,10
END
IDD_ADD_VARIABLE DIALOG 0, 0, 422, 102
Index: code/fred2/missionsave.cpp
===================================================================
--- code/fred2/missionsave.cpp (revision 10946)
+++ code/fred2/missionsave.cpp (working copy)
@@ -1742,6 +1742,8 @@
fout(" \"weapons-locked\"");
if (shipp->flags2 & SF2_SCRAMBLE_MESSAGES)
fout(" \"scramble-messages\"");
+ if (shipp->flags2 & SF2_NO_COLLIDE)
+ fout(" \"no-collide\"");
fout(" )");
}
// -----------------------------------------------------------
Index: code/fred2/resource.h
===================================================================
--- code/fred2/resource.h (revision 10946)
+++ code/fred2/resource.h (working copy)
@@ -1179,6 +1179,7 @@
#define IDC_MISSION_LOG_LAST_REPEAT 1640
#define IDC_MISSION_LOG_1ST_TRIGGER 1641
#define IDC_MISSION_LOG_LAST_TRIGGER 1642
+#define IDC_NO_COLLIDE 1643
#define ID_FILE_MISSIONNOTES 32771
#define ID_DUPLICATE 32774
#define ID_VIEW_ROTATE 32775
@@ -1471,7 +1472,7 @@
#define _APS_3D_CONTROLS 1
#define _APS_NEXT_RESOURCE_VALUE 320
#define _APS_NEXT_COMMAND_VALUE 33098
-#define _APS_NEXT_CONTROL_VALUE 1643
+#define _APS_NEXT_CONTROL_VALUE 1644
#define _APS_NEXT_SYMED_VALUE 105
#endif
#endif
Index: code/fred2/shipflagsdlg.cpp
===================================================================
--- code/fred2/shipflagsdlg.cpp (revision 10946)
+++ code/fred2/shipflagsdlg.cpp (working copy)
@@ -74,6 +74,7 @@
DDX_Control(pDX, IDC_HIDE_SHIP_NAME, m_hide_ship_name);
DDX_Control(pDX, IDC_DISABLE_ETS, m_disable_ets);
DDX_Control(pDX, IDC_CLOAKED, m_cloaked);
+ DDX_Control(pDX, IDC_NO_COLLIDE, m_no_collide);
DDX_Control(pDX, IDC_SET_CLASS_DYNAMICALLY, m_set_class_dynamically);
DDX_Control(pDX, IDC_SCRAMBLE_MESSAGES, m_scramble_messages);
//}}AFX_DATA_MAP
@@ -140,6 +141,7 @@
ON_BN_CLICKED(IDC_DISABLE_ETS, OnDisableETS)
ON_BN_CLICKED(IDC_CLOAKED, OnCloaked)
ON_BN_CLICKED(IDC_SCRAMBLE_MESSAGES, OnScrambleMessages)
+ ON_BN_CLICKED(IDC_NO_COLLIDE, OnNoCollide)
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
@@ -161,7 +163,7 @@
int toggle_subsystem_scanning = 0, scannable = 0, kamikaze = 0, no_dynamic = 0, red_alert_carry = 0;
int special_warpin = 0, disable_messages = 0, guardian = 0, vaporize = 0, stealth = 0, friendly_stealth_invisible = 0;
int no_death_scream = 0, always_death_scream = 0, scramble_messages = 0;
- int nav_carry = 0, nav_needslink = 0, hide_ship_name = 0, set_class_dynamically = 0, no_ets = 0, cloaked = 0;
+ int nav_carry = 0, nav_needslink = 0, hide_ship_name = 0, set_class_dynamically = 0, no_ets = 0, cloaked = 0, no_collide = 0;
object *objp;
ship *shipp;
@@ -210,6 +212,7 @@
no_ets = (shipp->flags2 & SF2_NO_ETS) ? 1 : 0;
cloaked = (shipp->flags2 & SF2_CLOAKED) ? 1 : 0;
scramble_messages = (shipp->flags2 & SF2_SCRAMBLE_MESSAGES) ? 1 : 0;
+ no_collide = (shipp->flags2 & SF2_NO_COLLIDE) ? 1 : 0;
destroy_before_mission = (shipp->flags & SF_KILL_BEFORE_MISSION) ? 1 : 0;
m_destroy_value.init(shipp->final_death_time);
@@ -270,6 +273,7 @@
no_ets = tristate_set(shipp->flags2 & SF2_NO_ETS, no_ets);
cloaked = tristate_set(shipp->flags2 & SF2_CLOAKED, cloaked);
scramble_messages = tristate_set(shipp->flags2 & SF2_SCRAMBLE_MESSAGES, scramble_messages);
+ no_collide = tristate_set(shipp->flags2 & SF2_NO_COLLIDE, no_collide);
// check the final death time and set the internal variable according to whether or not
// the final_death_time is set. Also, the value in the edit box must be set if all the
@@ -344,6 +348,7 @@
m_disable_ets.SetCheck(no_ets);
m_cloaked.SetCheck(cloaked);
m_scramble_messages.SetCheck(scramble_messages);
+ m_no_collide.SetCheck(no_collide);
m_kdamage.setup(IDC_KDAMAGE, this);
m_destroy_value.setup(IDC_DESTROY_VALUE, this);
@@ -961,6 +966,22 @@
break;
}
+ switch (m_no_collide.GetCheck()) {
+ case 1:
+ if ( !(shipp->flags2 & SF2_NO_COLLIDE) )
+ set_modified();
+
+ shipp->flags2 |= SF2_NO_COLLIDE;
+ break;
+
+ case 0:
+ if ( shipp->flags2 & SF2_NO_COLLIDE )
+ set_modified();
+
+ shipp->flags2 &= ~SF2_NO_COLLIDE;
+ break;
+ }
+
switch (m_guardian.GetCheck()) {
case 1:
if ( !(shipp->ship_guardian_threshold) )
@@ -1410,3 +1431,12 @@
m_scramble_messages.SetCheck(1);
}
}
+
+void ship_flags_dlg::OnNoCollide()
+{
+ if (m_no_collide.GetCheck() == 1) {
+ m_no_collide.SetCheck(0);
+ } else {
+ m_no_collide.SetCheck(1);
+ }
+}
Index: code/fred2/shipflagsdlg.h
===================================================================
--- code/fred2/shipflagsdlg.h (revision 10946)
+++ code/fred2/shipflagsdlg.h (working copy)
@@ -65,6 +65,7 @@
CButton m_hide_ship_name;
CButton m_disable_ets;
CButton m_cloaked;
+ CButton m_no_collide;
CButton m_set_class_dynamically;
CButton m_scramble_messages;
@@ -126,6 +127,7 @@
afx_msg void OnDisableETS();
afx_msg void OnCloaked();
afx_msg void OnScrambleMessages();
+ afx_msg void OnNoCollide();
//}}AFX_MSG
DECLARE_MESSAGE_MAP()
};
Index: code/mission/missionparse.cpp
===================================================================
--- code/mission/missionparse.cpp (revision 10946)
+++ code/mission/missionparse.cpp (working copy)
@@ -311,6 +311,7 @@
"ship-locked",
"weapons-locked",
"scramble-messages",
+ "no-collide",
};
char *Mission_event_log_flags[MAX_MISSION_EVENT_LOG_FLAGS] = {
@@ -2582,6 +2583,9 @@
if (parse_flags2 & P2_SF2_SCRAMBLE_MESSAGES)
shipp->flags2 |= SF2_SCRAMBLE_MESSAGES;
+
+ if (parse_flags2 & P2_SF2_NO_COLLIDE)
+ shipp->flags2 |= SF2_NO_COLLIDE;
}
void fix_old_special_explosions(p_object *p_objp, int variable_index)
Index: code/mission/missionparse.h
===================================================================
--- code/mission/missionparse.h (revision 10946)
+++ code/mission/missionparse.h (working copy)
@@ -487,7 +487,7 @@
// same caveat: This list of bitfield indicators MUST correspond EXACTLY
// (i.e., order and position must be the same) to its counterpart in MissionParse.cpp!!!!
-#define MAX_PARSE_OBJECT_FLAGS_2 23
+#define MAX_PARSE_OBJECT_FLAGS_2 24
#define P2_SF2_PRIMITIVE_SENSORS (1<<0)
#define P2_SF2_NO_SUBSPACE_DRIVE (1<<1)
@@ -512,6 +512,7 @@
#define P2_SF2_SHIP_LOCKED (1<<20)
#define P2_SF2_WEAPONS_LOCKED (1<<21)
#define P2_SF2_SCRAMBLE_MESSAGES (1<<22)
+#define P2_SF2_NO_COLLIDE (1<<23)
// and again: these flags do not appear in the array
//#define blah (1<<28)
Index: code/object/collideshipship.cpp
===================================================================
--- code/object/collideshipship.cpp (revision 10946)
+++ code/object/collideshipship.cpp (working copy)
@@ -173,11 +173,11 @@
}
// If either of these objects doesn't get collision checks, abort.
- if (heavy_sip->flags & SIF_NO_COLLIDE) {
+ if (heavy_shipp->flags2 & SF2_NO_COLLIDE) {
return 0;
}
- if (light_sip->flags & SIF_NO_COLLIDE) {
+ if (light_shipp->flags2 & SF2_NO_COLLIDE) {
return 0;
}
Index: code/object/collideshipweapon.cpp
===================================================================
--- code/object/collideshipweapon.cpp (revision 10946)
+++ code/object/collideshipweapon.cpp (working copy)
@@ -142,7 +142,7 @@
if ( shipp->flags & SF_ARRIVING ) return 0;
// If either of these objects doesn't get collision checks, abort.
- if (Ship_info[shipp->ship_info_index].flags & SIF_NO_COLLIDE)
+ if ( shipp->flags2 & SF2_NO_COLLIDE )
return 0;
// Return information for AI to detect incoming fire.
Index: code/ship/ship.cpp
===================================================================
--- code/ship/ship.cpp (revision 10946)
+++ code/ship/ship.cpp (working copy)
@@ -381,6 +381,7 @@
{SF2_DONT_COLLIDE_INVIS, "don't-collide-invisible", 2, },
{SF2_NO_ETS, "no-ets", 2, },
{SF2_TOGGLE_SUBSYSTEM_SCANNING, "toggle-subsystem-scanning", 2, },
+ {SF2_NO_COLLIDE, "no-collide", 2, },
};
const int num_ai_tgt_weapon_flags = sizeof(ai_tgt_weapon_flags) / sizeof(flag_def_list);
@@ -9423,10 +9424,10 @@
else if (sip_orig->flags & SIF_SHIP_CLASS_DONT_COLLIDE_INVIS) // changing FROM a don't-collide-invisible ship class
sp->flags2 &= ~SF2_DONT_COLLIDE_INVIS;
- if (sip->flags & SIF_NO_COLLIDE) // changing TO a no_collide ship
- Objects[sp->objnum].flags &= ~OF_COLLIDES;
- else if (sip_orig->flags & SIF_NO_COLLIDE) // changing FROM a no_collide ship
- Objects[sp->objnum].flags |= OF_COLLIDES;
+ if (sip->flags & SIF_NO_COLLIDE) // changing TO a no-collision ship class
+ sp->flags2 |= SF2_NO_COLLIDE;
+ else if (sip_orig->flags & SIF_NO_COLLIDE) // changing FROM a no-collision ship class
+ sp->flags2 &= ~SF2_NO_COLLIDE;
if (sip->flags2 & SIF2_NO_ETS)
sp->flags2 |= SF2_NO_ETS;
Index: code/ship/ship.h
===================================================================
--- code/ship/ship.h (revision 10946)
+++ code/ship/ship.h (working copy)
@@ -424,7 +424,7 @@
int flag_list; // is this flag in the 1st or 2nd ship flags list?
} ship_flag_name;
-#define MAX_SHIP_FLAG_NAMES 17
+#define MAX_SHIP_FLAG_NAMES 18
extern ship_flag_name Ship_flag_names[];
// states for the flags variable within the ship structure
@@ -505,6 +505,7 @@
#define SF2_WEAPONS_LOCKED (1<<25) // Karajorma - Prevents the player from changing the weapons on the ship on the loadout screen
#define SF2_SHIP_SELECTIVE_LINKING (1<<26) // RSAXVC - Allow pilot to pick firing configuration
#define SF2_SCRAMBLE_MESSAGES (1<<27) // Goober5000 - all messages sent from this ship appear scrambled
+#define SF2_NO_COLLIDE (1<<28) // FUBAR - Removes the ship from collision checks
// If any of these bits in the ship->flags are set, ignore this ship when targeting
extern int TARGET_SHIP_IGNORE_FLAGS;
-
2887.patch (11,228 bytes) 2014-07-27 05:23
Index: code/ai/aiturret.cpp
===================================================================
--- code/ai/aiturret.cpp (revision 10953)
+++ code/ai/aiturret.cpp (working copy)
@@ -479,7 +479,7 @@
}
// don't shoot at ships without collision check
- if (sip->flags & SIF_NO_COLLIDE) {
+ if (shipp->flags2 & SF2_NO_COLLIDE) {
return 0;
}
Index: code/fred2/fred.rc
===================================================================
--- code/fred2/fred.rc (revision 10953)
+++ code/fred2/fred.rc (working copy)
@@ -1837,6 +1837,7 @@
CONTROL "Does Not Move",IDC_IMMOBILE,"Button",BS_3STATE | WS_TABSTOP,7,274,66,10
CONTROL "Cloaked",IDC_CLOAKED,"Button",BS_3STATE | WS_TABSTOP,165,167,42,10
CONTROL "Scramble Messages",IDC_SCRAMBLE_MESSAGES,"Button",BS_3STATE | WS_TABSTOP,165,177,79,10
+ CONTROL "No Collisions",IDC_NO_COLLIDE,"Button",BS_3STATE | WS_TABSTOP,165,179,66,10
END
IDD_ADD_VARIABLE DIALOG 0, 0, 422, 102
Index: code/fred2/missionsave.cpp
===================================================================
--- code/fred2/missionsave.cpp (revision 10953)
+++ code/fred2/missionsave.cpp (working copy)
@@ -1742,6 +1742,8 @@
fout(" \"weapons-locked\"");
if (shipp->flags2 & SF2_SCRAMBLE_MESSAGES)
fout(" \"scramble-messages\"");
+ if (shipp->flags2 & SF2_NO_COLLIDE)
+ fout(" \"no-collide\"");
fout(" )");
}
// -----------------------------------------------------------
Index: code/fred2/resource.h
===================================================================
--- code/fred2/resource.h (revision 10953)
+++ code/fred2/resource.h (working copy)
@@ -1179,6 +1179,7 @@
#define IDC_MISSION_LOG_LAST_REPEAT 1640
#define IDC_MISSION_LOG_1ST_TRIGGER 1641
#define IDC_MISSION_LOG_LAST_TRIGGER 1642
+#define IDC_NO_COLLIDE 1643
#define ID_FILE_MISSIONNOTES 32771
#define ID_DUPLICATE 32774
#define ID_VIEW_ROTATE 32775
@@ -1471,7 +1472,7 @@
#define _APS_3D_CONTROLS 1
#define _APS_NEXT_RESOURCE_VALUE 320
#define _APS_NEXT_COMMAND_VALUE 33098
-#define _APS_NEXT_CONTROL_VALUE 1643
+#define _APS_NEXT_CONTROL_VALUE 1644
#define _APS_NEXT_SYMED_VALUE 105
#endif
#endif
Index: code/fred2/shipflagsdlg.cpp
===================================================================
--- code/fred2/shipflagsdlg.cpp (revision 10953)
+++ code/fred2/shipflagsdlg.cpp (working copy)
@@ -74,6 +74,7 @@
DDX_Control(pDX, IDC_HIDE_SHIP_NAME, m_hide_ship_name);
DDX_Control(pDX, IDC_DISABLE_ETS, m_disable_ets);
DDX_Control(pDX, IDC_CLOAKED, m_cloaked);
+ DDX_Control(pDX, IDC_NO_COLLIDE, m_no_collide);
DDX_Control(pDX, IDC_SET_CLASS_DYNAMICALLY, m_set_class_dynamically);
DDX_Control(pDX, IDC_SCRAMBLE_MESSAGES, m_scramble_messages);
//}}AFX_DATA_MAP
@@ -140,6 +141,7 @@
ON_BN_CLICKED(IDC_DISABLE_ETS, OnDisableETS)
ON_BN_CLICKED(IDC_CLOAKED, OnCloaked)
ON_BN_CLICKED(IDC_SCRAMBLE_MESSAGES, OnScrambleMessages)
+ ON_BN_CLICKED(IDC_NO_COLLIDE, OnNoCollide)
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
@@ -161,7 +163,7 @@
int toggle_subsystem_scanning = 0, scannable = 0, kamikaze = 0, no_dynamic = 0, red_alert_carry = 0;
int special_warpin = 0, disable_messages = 0, guardian = 0, vaporize = 0, stealth = 0, friendly_stealth_invisible = 0;
int no_death_scream = 0, always_death_scream = 0, scramble_messages = 0;
- int nav_carry = 0, nav_needslink = 0, hide_ship_name = 0, set_class_dynamically = 0, no_ets = 0, cloaked = 0;
+ int nav_carry = 0, nav_needslink = 0, hide_ship_name = 0, set_class_dynamically = 0, no_ets = 0, cloaked = 0, no_collide = 0;
object *objp;
ship *shipp;
@@ -210,6 +212,7 @@
no_ets = (shipp->flags2 & SF2_NO_ETS) ? 1 : 0;
cloaked = (shipp->flags2 & SF2_CLOAKED) ? 1 : 0;
scramble_messages = (shipp->flags2 & SF2_SCRAMBLE_MESSAGES) ? 1 : 0;
+ no_collide = (shipp->flags2 & SF2_NO_COLLIDE) ? 1 : 0;
destroy_before_mission = (shipp->flags & SF_KILL_BEFORE_MISSION) ? 1 : 0;
m_destroy_value.init(shipp->final_death_time);
@@ -270,6 +273,7 @@
no_ets = tristate_set(shipp->flags2 & SF2_NO_ETS, no_ets);
cloaked = tristate_set(shipp->flags2 & SF2_CLOAKED, cloaked);
scramble_messages = tristate_set(shipp->flags2 & SF2_SCRAMBLE_MESSAGES, scramble_messages);
+ no_collide = tristate_set(shipp->flags2 & SF2_NO_COLLIDE, no_collide);
// check the final death time and set the internal variable according to whether or not
// the final_death_time is set. Also, the value in the edit box must be set if all the
@@ -344,6 +348,7 @@
m_disable_ets.SetCheck(no_ets);
m_cloaked.SetCheck(cloaked);
m_scramble_messages.SetCheck(scramble_messages);
+ m_no_collide.SetCheck(no_collide);
m_kdamage.setup(IDC_KDAMAGE, this);
m_destroy_value.setup(IDC_DESTROY_VALUE, this);
@@ -961,6 +966,22 @@
break;
}
+ switch (m_no_collide.GetCheck()) {
+ case 1:
+ if ( !(shipp->flags2 & SF2_NO_COLLIDE) )
+ set_modified();
+
+ shipp->flags2 |= SF2_NO_COLLIDE;
+ break;
+
+ case 0:
+ if ( shipp->flags2 & SF2_NO_COLLIDE )
+ set_modified();
+
+ shipp->flags2 &= ~SF2_NO_COLLIDE;
+ break;
+ }
+
switch (m_guardian.GetCheck()) {
case 1:
if ( !(shipp->ship_guardian_threshold) )
@@ -1410,3 +1431,12 @@
m_scramble_messages.SetCheck(1);
}
}
+
+void ship_flags_dlg::OnNoCollide()
+{
+ if (m_no_collide.GetCheck() == 1) {
+ m_no_collide.SetCheck(0);
+ } else {
+ m_no_collide.SetCheck(1);
+ }
+}
Index: code/fred2/shipflagsdlg.h
===================================================================
--- code/fred2/shipflagsdlg.h (revision 10953)
+++ code/fred2/shipflagsdlg.h (working copy)
@@ -65,6 +65,7 @@
CButton m_hide_ship_name;
CButton m_disable_ets;
CButton m_cloaked;
+ CButton m_no_collide;
CButton m_set_class_dynamically;
CButton m_scramble_messages;
@@ -126,6 +127,7 @@
afx_msg void OnDisableETS();
afx_msg void OnCloaked();
afx_msg void OnScrambleMessages();
+ afx_msg void OnNoCollide();
//}}AFX_MSG
DECLARE_MESSAGE_MAP()
};
Index: code/mission/missionparse.cpp
===================================================================
--- code/mission/missionparse.cpp (revision 10953)
+++ code/mission/missionparse.cpp (working copy)
@@ -311,6 +311,7 @@
"ship-locked",
"weapons-locked",
"scramble-messages",
+ "no-collide",
};
char *Mission_event_log_flags[MAX_MISSION_EVENT_LOG_FLAGS] = {
@@ -2582,6 +2583,9 @@
if (parse_flags2 & P2_SF2_SCRAMBLE_MESSAGES)
shipp->flags2 |= SF2_SCRAMBLE_MESSAGES;
+
+ if (parse_flags2 & P2_SF2_NO_COLLIDE)
+ shipp->flags2 |= SF2_NO_COLLIDE;
}
void fix_old_special_explosions(p_object *p_objp, int variable_index)
Index: code/mission/missionparse.h
===================================================================
--- code/mission/missionparse.h (revision 10953)
+++ code/mission/missionparse.h (working copy)
@@ -487,7 +487,7 @@
// same caveat: This list of bitfield indicators MUST correspond EXACTLY
// (i.e., order and position must be the same) to its counterpart in MissionParse.cpp!!!!
-#define MAX_PARSE_OBJECT_FLAGS_2 23
+#define MAX_PARSE_OBJECT_FLAGS_2 24
#define P2_SF2_PRIMITIVE_SENSORS (1<<0)
#define P2_SF2_NO_SUBSPACE_DRIVE (1<<1)
@@ -512,6 +512,7 @@
#define P2_SF2_SHIP_LOCKED (1<<20)
#define P2_SF2_WEAPONS_LOCKED (1<<21)
#define P2_SF2_SCRAMBLE_MESSAGES (1<<22)
+#define P2_SF2_NO_COLLIDE (1<<23)
// and again: these flags do not appear in the array
//#define blah (1<<28)
Index: code/object/collideshipship.cpp
===================================================================
--- code/object/collideshipship.cpp (revision 10953)
+++ code/object/collideshipship.cpp (working copy)
@@ -173,11 +173,11 @@
}
// If either of these objects doesn't get collision checks, abort.
- if (heavy_sip->flags & SIF_NO_COLLIDE) {
+ if (heavy_shipp->flags2 & SF2_NO_COLLIDE) {
return 0;
}
- if (light_sip->flags & SIF_NO_COLLIDE) {
+ if (light_shipp->flags2 & SF2_NO_COLLIDE) {
return 0;
}
Index: code/object/collideshipweapon.cpp
===================================================================
--- code/object/collideshipweapon.cpp (revision 10953)
+++ code/object/collideshipweapon.cpp (working copy)
@@ -142,7 +142,7 @@
if ( shipp->flags & SF_ARRIVING ) return 0;
// If either of these objects doesn't get collision checks, abort.
- if (Ship_info[shipp->ship_info_index].flags & SIF_NO_COLLIDE)
+ if ( shipp->flags2 & SF2_NO_COLLIDE )
return 0;
// Return information for AI to detect incoming fire.
Index: code/ship/ship.cpp
===================================================================
--- code/ship/ship.cpp (revision 10953)
+++ code/ship/ship.cpp (working copy)
@@ -381,6 +381,7 @@
{SF2_DONT_COLLIDE_INVIS, "don't-collide-invisible", 2, },
{SF2_NO_ETS, "no-ets", 2, },
{SF2_TOGGLE_SUBSYSTEM_SCANNING, "toggle-subsystem-scanning", 2, },
+ {SF2_NO_COLLIDE, "no-collide", 2, },
};
const int num_ai_tgt_weapon_flags = sizeof(ai_tgt_weapon_flags) / sizeof(flag_def_list);
@@ -5137,6 +5138,8 @@
shipp->flags2 |= SF2_STEALTH;
if (sip->flags & SIF_SHIP_CLASS_DONT_COLLIDE_INVIS)
shipp->flags2 |= SF2_DONT_COLLIDE_INVIS;
+ if (sip->flags & SIF_NO_COLLIDE)
+ shipp->flags2 |= SF2_NO_COLLIDE;
if (sip->flags2 & SIF2_NO_ETS)
shipp->flags2 |= SF2_NO_ETS;
@@ -9423,10 +9426,10 @@
else if (sip_orig->flags & SIF_SHIP_CLASS_DONT_COLLIDE_INVIS) // changing FROM a don't-collide-invisible ship class
sp->flags2 &= ~SF2_DONT_COLLIDE_INVIS;
- if (sip->flags & SIF_NO_COLLIDE) // changing TO a no_collide ship
- Objects[sp->objnum].flags &= ~OF_COLLIDES;
- else if (sip_orig->flags & SIF_NO_COLLIDE) // changing FROM a no_collide ship
- Objects[sp->objnum].flags |= OF_COLLIDES;
+ if (sip->flags & SIF_NO_COLLIDE) // changing TO a no-collision ship class
+ sp->flags2 |= SF2_NO_COLLIDE;
+ else if (sip_orig->flags & SIF_NO_COLLIDE) // changing FROM a no-collision ship class
+ sp->flags2 &= ~SF2_NO_COLLIDE;
if (sip->flags2 & SIF2_NO_ETS)
sp->flags2 |= SF2_NO_ETS;
Index: code/ship/ship.h
===================================================================
--- code/ship/ship.h (revision 10953)
+++ code/ship/ship.h (working copy)
@@ -424,7 +424,7 @@
int flag_list; // is this flag in the 1st or 2nd ship flags list?
} ship_flag_name;
-#define MAX_SHIP_FLAG_NAMES 17
+#define MAX_SHIP_FLAG_NAMES 18
extern ship_flag_name Ship_flag_names[];
// states for the flags variable within the ship structure
@@ -505,6 +505,7 @@
#define SF2_WEAPONS_LOCKED (1<<25) // Karajorma - Prevents the player from changing the weapons on the ship on the loadout screen
#define SF2_SHIP_SELECTIVE_LINKING (1<<26) // RSAXVC - Allow pilot to pick firing configuration
#define SF2_SCRAMBLE_MESSAGES (1<<27) // Goober5000 - all messages sent from this ship appear scrambled
+#define SF2_NO_COLLIDE (1<<28) // FUBAR - Removes the ship from collision checks
// If any of these bits in the ship->flags are set, ignore this ship when targeting
extern int TARGET_SHIP_IGNORE_FLAGS;
-
2887_fixed.patch (11,302 bytes) 2014-07-30 08:52
Index: code/ai/aiturret.cpp
===================================================================
--- code/ai/aiturret.cpp (revision 10961)
+++ code/ai/aiturret.cpp (working copy)
@@ -479,7 +479,7 @@
}
// don't shoot at ships without collision check
- if (sip->flags & SIF_NO_COLLIDE) {
+ if (shipp->flags2 & SF2_NO_COLLIDE) {
return 0;
}
Index: code/fred2/fred.rc
===================================================================
--- code/fred2/fred.rc (revision 10961)
+++ code/fred2/fred.rc (working copy)
@@ -1837,6 +1837,7 @@
CONTROL "Does Not Move",IDC_IMMOBILE,"Button",BS_3STATE | WS_TABSTOP,7,274,66,10
CONTROL "Cloaked",IDC_CLOAKED,"Button",BS_3STATE | WS_TABSTOP,165,167,42,10
CONTROL "Scramble Messages",IDC_SCRAMBLE_MESSAGES,"Button",BS_3STATE | WS_TABSTOP,165,177,79,10
+ CONTROL "No Collisions",IDC_NO_COLLIDE,"Button",BS_3STATE | WS_TABSTOP,165,188,66,10
END
IDD_ADD_VARIABLE DIALOG 0, 0, 422, 102
Index: code/fred2/missionsave.cpp
===================================================================
--- code/fred2/missionsave.cpp (revision 10961)
+++ code/fred2/missionsave.cpp (working copy)
@@ -1742,6 +1742,8 @@
fout(" \"weapons-locked\"");
if (shipp->flags2 & SF2_SCRAMBLE_MESSAGES)
fout(" \"scramble-messages\"");
+ if (shipp->flags2 & SF2_NO_COLLIDE)
+ fout(" \"no-collide\"");
fout(" )");
}
// -----------------------------------------------------------
Index: code/fred2/resource.h
===================================================================
--- code/fred2/resource.h (revision 10961)
+++ code/fred2/resource.h (working copy)
@@ -1179,6 +1179,7 @@
#define IDC_MISSION_LOG_LAST_REPEAT 1640
#define IDC_MISSION_LOG_1ST_TRIGGER 1641
#define IDC_MISSION_LOG_LAST_TRIGGER 1642
+#define IDC_NO_COLLIDE 1643
#define ID_FILE_MISSIONNOTES 32771
#define ID_DUPLICATE 32774
#define ID_VIEW_ROTATE 32775
@@ -1471,7 +1472,7 @@
#define _APS_3D_CONTROLS 1
#define _APS_NEXT_RESOURCE_VALUE 320
#define _APS_NEXT_COMMAND_VALUE 33098
-#define _APS_NEXT_CONTROL_VALUE 1643
+#define _APS_NEXT_CONTROL_VALUE 1644
#define _APS_NEXT_SYMED_VALUE 105
#endif
#endif
Index: code/fred2/shipflagsdlg.cpp
===================================================================
--- code/fred2/shipflagsdlg.cpp (revision 10961)
+++ code/fred2/shipflagsdlg.cpp (working copy)
@@ -74,6 +74,7 @@
DDX_Control(pDX, IDC_HIDE_SHIP_NAME, m_hide_ship_name);
DDX_Control(pDX, IDC_DISABLE_ETS, m_disable_ets);
DDX_Control(pDX, IDC_CLOAKED, m_cloaked);
+ DDX_Control(pDX, IDC_NO_COLLIDE, m_no_collide);
DDX_Control(pDX, IDC_SET_CLASS_DYNAMICALLY, m_set_class_dynamically);
DDX_Control(pDX, IDC_SCRAMBLE_MESSAGES, m_scramble_messages);
//}}AFX_DATA_MAP
@@ -140,6 +141,7 @@
ON_BN_CLICKED(IDC_DISABLE_ETS, OnDisableETS)
ON_BN_CLICKED(IDC_CLOAKED, OnCloaked)
ON_BN_CLICKED(IDC_SCRAMBLE_MESSAGES, OnScrambleMessages)
+ ON_BN_CLICKED(IDC_NO_COLLIDE, OnNoCollide)
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
@@ -161,7 +163,7 @@
int toggle_subsystem_scanning = 0, scannable = 0, kamikaze = 0, no_dynamic = 0, red_alert_carry = 0;
int special_warpin = 0, disable_messages = 0, guardian = 0, vaporize = 0, stealth = 0, friendly_stealth_invisible = 0;
int no_death_scream = 0, always_death_scream = 0, scramble_messages = 0;
- int nav_carry = 0, nav_needslink = 0, hide_ship_name = 0, set_class_dynamically = 0, no_ets = 0, cloaked = 0;
+ int nav_carry = 0, nav_needslink = 0, hide_ship_name = 0, set_class_dynamically = 0, no_ets = 0, cloaked = 0, no_collide = 0;
object *objp;
ship *shipp;
@@ -210,6 +212,7 @@
no_ets = (shipp->flags2 & SF2_NO_ETS) ? 1 : 0;
cloaked = (shipp->flags2 & SF2_CLOAKED) ? 1 : 0;
scramble_messages = (shipp->flags2 & SF2_SCRAMBLE_MESSAGES) ? 1 : 0;
+ no_collide = (shipp->flags2 & SF2_NO_COLLIDE) ? 1 : 0;
destroy_before_mission = (shipp->flags & SF_KILL_BEFORE_MISSION) ? 1 : 0;
m_destroy_value.init(shipp->final_death_time);
@@ -270,6 +273,7 @@
no_ets = tristate_set(shipp->flags2 & SF2_NO_ETS, no_ets);
cloaked = tristate_set(shipp->flags2 & SF2_CLOAKED, cloaked);
scramble_messages = tristate_set(shipp->flags2 & SF2_SCRAMBLE_MESSAGES, scramble_messages);
+ no_collide = tristate_set(shipp->flags2 & SF2_NO_COLLIDE, no_collide);
// check the final death time and set the internal variable according to whether or not
// the final_death_time is set. Also, the value in the edit box must be set if all the
@@ -344,6 +348,7 @@
m_disable_ets.SetCheck(no_ets);
m_cloaked.SetCheck(cloaked);
m_scramble_messages.SetCheck(scramble_messages);
+ m_no_collide.SetCheck(no_collide);
m_kdamage.setup(IDC_KDAMAGE, this);
m_destroy_value.setup(IDC_DESTROY_VALUE, this);
@@ -961,6 +966,22 @@
break;
}
+ switch (m_no_collide.GetCheck()) {
+ case 1:
+ if ( !(shipp->flags2 & SF2_NO_COLLIDE) )
+ set_modified();
+
+ shipp->flags2 |= SF2_NO_COLLIDE;
+ break;
+
+ case 0:
+ if ( shipp->flags2 & SF2_NO_COLLIDE )
+ set_modified();
+
+ shipp->flags2 &= ~SF2_NO_COLLIDE;
+ break;
+ }
+
switch (m_guardian.GetCheck()) {
case 1:
if ( !(shipp->ship_guardian_threshold) )
@@ -1410,3 +1431,12 @@
m_scramble_messages.SetCheck(1);
}
}
+
+void ship_flags_dlg::OnNoCollide()
+{
+ if (m_no_collide.GetCheck() == 1) {
+ m_no_collide.SetCheck(0);
+ } else {
+ m_no_collide.SetCheck(1);
+ }
+}
Index: code/fred2/shipflagsdlg.h
===================================================================
--- code/fred2/shipflagsdlg.h (revision 10961)
+++ code/fred2/shipflagsdlg.h (working copy)
@@ -65,6 +65,7 @@
CButton m_hide_ship_name;
CButton m_disable_ets;
CButton m_cloaked;
+ CButton m_no_collide;
CButton m_set_class_dynamically;
CButton m_scramble_messages;
@@ -126,6 +127,7 @@
afx_msg void OnDisableETS();
afx_msg void OnCloaked();
afx_msg void OnScrambleMessages();
+ afx_msg void OnNoCollide();
//}}AFX_MSG
DECLARE_MESSAGE_MAP()
};
Index: code/mission/missionparse.cpp
===================================================================
--- code/mission/missionparse.cpp (revision 10961)
+++ code/mission/missionparse.cpp (working copy)
@@ -311,6 +311,7 @@
"ship-locked",
"weapons-locked",
"scramble-messages",
+ "no-collide",
};
char *Mission_event_log_flags[MAX_MISSION_EVENT_LOG_FLAGS] = {
@@ -2582,6 +2583,9 @@
if (parse_flags2 & P2_SF2_SCRAMBLE_MESSAGES)
shipp->flags2 |= SF2_SCRAMBLE_MESSAGES;
+
+ if (parse_flags2 & P2_SF2_NO_COLLIDE)
+ shipp->flags2 |= SF2_NO_COLLIDE;
}
void fix_old_special_explosions(p_object *p_objp, int variable_index)
Index: code/mission/missionparse.h
===================================================================
--- code/mission/missionparse.h (revision 10961)
+++ code/mission/missionparse.h (working copy)
@@ -487,7 +487,7 @@
// same caveat: This list of bitfield indicators MUST correspond EXACTLY
// (i.e., order and position must be the same) to its counterpart in MissionParse.cpp!!!!
-#define MAX_PARSE_OBJECT_FLAGS_2 23
+#define MAX_PARSE_OBJECT_FLAGS_2 24
#define P2_SF2_PRIMITIVE_SENSORS (1<<0)
#define P2_SF2_NO_SUBSPACE_DRIVE (1<<1)
@@ -512,6 +512,7 @@
#define P2_SF2_SHIP_LOCKED (1<<20)
#define P2_SF2_WEAPONS_LOCKED (1<<21)
#define P2_SF2_SCRAMBLE_MESSAGES (1<<22)
+#define P2_SF2_NO_COLLIDE (1<<23)
// and again: these flags do not appear in the array
//#define blah (1<<28)
Index: code/object/collideshipship.cpp
===================================================================
--- code/object/collideshipship.cpp (revision 10961)
+++ code/object/collideshipship.cpp (working copy)
@@ -173,11 +173,11 @@
}
// If either of these objects doesn't get collision checks, abort.
- if (heavy_sip->flags & SIF_NO_COLLIDE) {
+ if (heavy_shipp->flags2 & SF2_NO_COLLIDE) {
return 0;
}
- if (light_sip->flags & SIF_NO_COLLIDE) {
+ if (light_shipp->flags2 & SF2_NO_COLLIDE) {
return 0;
}
Index: code/object/collideshipweapon.cpp
===================================================================
--- code/object/collideshipweapon.cpp (revision 10961)
+++ code/object/collideshipweapon.cpp (working copy)
@@ -142,7 +142,7 @@
if ( shipp->flags & SF_ARRIVING ) return 0;
// If either of these objects doesn't get collision checks, abort.
- if (Ship_info[shipp->ship_info_index].flags & SIF_NO_COLLIDE)
+ if ( shipp->flags2 & SF2_NO_COLLIDE )
return 0;
// Return information for AI to detect incoming fire.
Index: code/ship/ship.cpp
===================================================================
--- code/ship/ship.cpp (revision 10961)
+++ code/ship/ship.cpp (working copy)
@@ -381,6 +381,7 @@
{SF2_DONT_COLLIDE_INVIS, "don't-collide-invisible", 2, },
{SF2_NO_ETS, "no-ets", 2, },
{SF2_TOGGLE_SUBSYSTEM_SCANNING, "toggle-subsystem-scanning", 2, },
+ {SF2_NO_COLLIDE, "no-collide", 2, },
};
const int num_ai_tgt_weapon_flags = sizeof(ai_tgt_weapon_flags) / sizeof(flag_def_list);
@@ -5137,6 +5138,8 @@
shipp->flags2 |= SF2_STEALTH;
if (sip->flags & SIF_SHIP_CLASS_DONT_COLLIDE_INVIS)
shipp->flags2 |= SF2_DONT_COLLIDE_INVIS;
+ if (sip->flags & SIF_NO_COLLIDE)
+ shipp->flags2 |= SF2_NO_COLLIDE;
if (sip->flags2 & SIF2_NO_ETS)
shipp->flags2 |= SF2_NO_ETS;
@@ -9423,10 +9426,10 @@
else if (sip_orig->flags & SIF_SHIP_CLASS_DONT_COLLIDE_INVIS) // changing FROM a don't-collide-invisible ship class
sp->flags2 &= ~SF2_DONT_COLLIDE_INVIS;
- if (sip->flags & SIF_NO_COLLIDE) // changing TO a no_collide ship
- Objects[sp->objnum].flags &= ~OF_COLLIDES;
- else if (sip_orig->flags & SIF_NO_COLLIDE) // changing FROM a no_collide ship
- Objects[sp->objnum].flags |= OF_COLLIDES;
+ if (sip->flags & SIF_NO_COLLIDE) // changing TO a no-collision ship class
+ sp->flags2 |= SF2_NO_COLLIDE;
+ else if (sip_orig->flags & SIF_NO_COLLIDE) // changing FROM a no-collision ship class
+ sp->flags2 &= ~SF2_NO_COLLIDE;
if (sip->flags2 & SIF2_NO_ETS)
sp->flags2 |= SF2_NO_ETS;
Index: code/ship/ship.h
===================================================================
--- code/ship/ship.h (revision 10961)
+++ code/ship/ship.h (working copy)
@@ -424,7 +424,7 @@
int flag_list; // is this flag in the 1st or 2nd ship flags list?
} ship_flag_name;
-#define MAX_SHIP_FLAG_NAMES 17
+#define MAX_SHIP_FLAG_NAMES 18
extern ship_flag_name Ship_flag_names[];
// states for the flags variable within the ship structure
@@ -505,6 +505,7 @@
#define SF2_WEAPONS_LOCKED (1<<25) // Karajorma - Prevents the player from changing the weapons on the ship on the loadout screen
#define SF2_SHIP_SELECTIVE_LINKING (1<<26) // RSAXVC - Allow pilot to pick firing configuration
#define SF2_SCRAMBLE_MESSAGES (1<<27) // Goober5000 - all messages sent from this ship appear scrambled
+#define SF2_NO_COLLIDE (1<<28) // FUBAR - Removes the ship from collision checks
// If any of these bits in the ship->flags are set, ignore this ship when targeting
extern int TARGET_SHIP_IGNORE_FLAGS;
-
2887_cleaned.patch (11,594 bytes) 2014-08-03 11:54
Index: code/ai/aiturret.cpp
===================================================================
--- code/ai/aiturret.cpp (revision 10966)
+++ code/ai/aiturret.cpp (working copy)
@@ -479,7 +479,7 @@
}
// don't shoot at ships without collision check
- if (sip->flags & SIF_NO_COLLIDE) {
+ if (!(objp->flags & OF_COLLIDES)) {
return 0;
}
Index: code/fred2/fred.rc
===================================================================
--- code/fred2/fred.rc (revision 10966)
+++ code/fred2/fred.rc (working copy)
@@ -1837,6 +1837,7 @@
CONTROL "Does Not Move",IDC_IMMOBILE,"Button",BS_3STATE | WS_TABSTOP,7,274,66,10
CONTROL "Cloaked",IDC_CLOAKED,"Button",BS_3STATE | WS_TABSTOP,165,167,42,10
CONTROL "Scramble Messages",IDC_SCRAMBLE_MESSAGES,"Button",BS_3STATE | WS_TABSTOP,165,177,79,10
+ CONTROL "No Collisions",IDC_NO_COLLIDE,"Button",BS_3STATE | WS_TABSTOP,165,188,66,10
END
IDD_ADD_VARIABLE DIALOG 0, 0, 422, 102
Index: code/fred2/missionsave.cpp
===================================================================
--- code/fred2/missionsave.cpp (revision 10966)
+++ code/fred2/missionsave.cpp (working copy)
@@ -1742,6 +1742,8 @@
fout(" \"weapons-locked\"");
if (shipp->flags2 & SF2_SCRAMBLE_MESSAGES)
fout(" \"scramble-messages\"");
+ if (!(objp->flags & OF_COLLIDES))
+ fout(" \"no-collide\"");
fout(" )");
}
// -----------------------------------------------------------
Index: code/fred2/resource.h
===================================================================
--- code/fred2/resource.h (revision 10966)
+++ code/fred2/resource.h (working copy)
@@ -1179,6 +1179,7 @@
#define IDC_MISSION_LOG_LAST_REPEAT 1640
#define IDC_MISSION_LOG_1ST_TRIGGER 1641
#define IDC_MISSION_LOG_LAST_TRIGGER 1642
+#define IDC_NO_COLLIDE 1643
#define ID_FILE_MISSIONNOTES 32771
#define ID_DUPLICATE 32774
#define ID_VIEW_ROTATE 32775
@@ -1471,7 +1472,7 @@
#define _APS_3D_CONTROLS 1
#define _APS_NEXT_RESOURCE_VALUE 320
#define _APS_NEXT_COMMAND_VALUE 33098
-#define _APS_NEXT_CONTROL_VALUE 1643
+#define _APS_NEXT_CONTROL_VALUE 1644
#define _APS_NEXT_SYMED_VALUE 105
#endif
#endif
Index: code/fred2/shipflagsdlg.cpp
===================================================================
--- code/fred2/shipflagsdlg.cpp (revision 10966)
+++ code/fred2/shipflagsdlg.cpp (working copy)
@@ -74,6 +74,7 @@
DDX_Control(pDX, IDC_HIDE_SHIP_NAME, m_hide_ship_name);
DDX_Control(pDX, IDC_DISABLE_ETS, m_disable_ets);
DDX_Control(pDX, IDC_CLOAKED, m_cloaked);
+ DDX_Control(pDX, IDC_NO_COLLIDE, m_no_collide);
DDX_Control(pDX, IDC_SET_CLASS_DYNAMICALLY, m_set_class_dynamically);
DDX_Control(pDX, IDC_SCRAMBLE_MESSAGES, m_scramble_messages);
//}}AFX_DATA_MAP
@@ -140,6 +141,7 @@
ON_BN_CLICKED(IDC_DISABLE_ETS, OnDisableETS)
ON_BN_CLICKED(IDC_CLOAKED, OnCloaked)
ON_BN_CLICKED(IDC_SCRAMBLE_MESSAGES, OnScrambleMessages)
+ ON_BN_CLICKED(IDC_NO_COLLIDE, OnNoCollide)
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
@@ -161,7 +163,7 @@
int toggle_subsystem_scanning = 0, scannable = 0, kamikaze = 0, no_dynamic = 0, red_alert_carry = 0;
int special_warpin = 0, disable_messages = 0, guardian = 0, vaporize = 0, stealth = 0, friendly_stealth_invisible = 0;
int no_death_scream = 0, always_death_scream = 0, scramble_messages = 0;
- int nav_carry = 0, nav_needslink = 0, hide_ship_name = 0, set_class_dynamically = 0, no_ets = 0, cloaked = 0;
+ int nav_carry = 0, nav_needslink = 0, hide_ship_name = 0, set_class_dynamically = 0, no_ets = 0, cloaked = 0, no_collide = 0;
object *objp;
ship *shipp;
@@ -210,6 +212,7 @@
no_ets = (shipp->flags2 & SF2_NO_ETS) ? 1 : 0;
cloaked = (shipp->flags2 & SF2_CLOAKED) ? 1 : 0;
scramble_messages = (shipp->flags2 & SF2_SCRAMBLE_MESSAGES) ? 1 : 0;
+ no_collide = (objp->flags & OF_COLLIDES) ? 0 : 1;
destroy_before_mission = (shipp->flags & SF_KILL_BEFORE_MISSION) ? 1 : 0;
m_destroy_value.init(shipp->final_death_time);
@@ -270,6 +273,7 @@
no_ets = tristate_set(shipp->flags2 & SF2_NO_ETS, no_ets);
cloaked = tristate_set(shipp->flags2 & SF2_CLOAKED, cloaked);
scramble_messages = tristate_set(shipp->flags2 & SF2_SCRAMBLE_MESSAGES, scramble_messages);
+ no_collide = tristate_set(!(objp->flags & OF_COLLIDES), no_collide);
// check the final death time and set the internal variable according to whether or not
// the final_death_time is set. Also, the value in the edit box must be set if all the
@@ -344,6 +348,7 @@
m_disable_ets.SetCheck(no_ets);
m_cloaked.SetCheck(cloaked);
m_scramble_messages.SetCheck(scramble_messages);
+ m_no_collide.SetCheck(no_collide);
m_kdamage.setup(IDC_KDAMAGE, this);
m_destroy_value.setup(IDC_DESTROY_VALUE, this);
@@ -961,6 +966,22 @@
break;
}
+ switch (m_no_collide.GetCheck()) {
+ case 1:
+ if ( objp->flags & OF_COLLIDES )
+ set_modified();
+
+ objp->flags &= ~OF_COLLIDES;
+ break;
+
+ case 0:
+ if (!(objp->flags & OF_COLLIDES))
+ set_modified();
+
+ objp->flags |= OF_COLLIDES;
+ break;
+ }
+
switch (m_guardian.GetCheck()) {
case 1:
if ( !(shipp->ship_guardian_threshold) )
@@ -1410,3 +1431,12 @@
m_scramble_messages.SetCheck(1);
}
}
+
+void ship_flags_dlg::OnNoCollide()
+{
+ if (m_no_collide.GetCheck() == 1) {
+ m_no_collide.SetCheck(0);
+ } else {
+ m_no_collide.SetCheck(1);
+ }
+}
Index: code/fred2/shipflagsdlg.h
===================================================================
--- code/fred2/shipflagsdlg.h (revision 10966)
+++ code/fred2/shipflagsdlg.h (working copy)
@@ -65,6 +65,7 @@
CButton m_hide_ship_name;
CButton m_disable_ets;
CButton m_cloaked;
+ CButton m_no_collide;
CButton m_set_class_dynamically;
CButton m_scramble_messages;
@@ -126,6 +127,7 @@
afx_msg void OnDisableETS();
afx_msg void OnCloaked();
afx_msg void OnScrambleMessages();
+ afx_msg void OnNoCollide();
//}}AFX_MSG
DECLARE_MESSAGE_MAP()
};
Index: code/mission/missionparse.cpp
===================================================================
--- code/mission/missionparse.cpp (revision 10966)
+++ code/mission/missionparse.cpp (working copy)
@@ -311,6 +311,7 @@
"ship-locked",
"weapons-locked",
"scramble-messages",
+ "no-collide",
};
char *Mission_event_log_flags[MAX_MISSION_EVENT_LOG_FLAGS] = {
@@ -2582,6 +2583,12 @@
if (parse_flags2 & P2_SF2_SCRAMBLE_MESSAGES)
shipp->flags2 |= SF2_SCRAMBLE_MESSAGES;
+
+ // Make sure that the correct flag is set in any case
+ if (parse_flags2 & P2_OF_NO_COLLIDE)
+ obj_set_flags(objp, objp->flags & ~OF_COLLIDES);
+ else
+ obj_set_flags(objp, objp->flags | OF_COLLIDES);
}
void fix_old_special_explosions(p_object *p_objp, int variable_index)
Index: code/mission/missionparse.h
===================================================================
--- code/mission/missionparse.h (revision 10966)
+++ code/mission/missionparse.h (working copy)
@@ -487,7 +487,7 @@
// same caveat: This list of bitfield indicators MUST correspond EXACTLY
// (i.e., order and position must be the same) to its counterpart in MissionParse.cpp!!!!
-#define MAX_PARSE_OBJECT_FLAGS_2 23
+#define MAX_PARSE_OBJECT_FLAGS_2 24
#define P2_SF2_PRIMITIVE_SENSORS (1<<0)
#define P2_SF2_NO_SUBSPACE_DRIVE (1<<1)
@@ -512,6 +512,7 @@
#define P2_SF2_SHIP_LOCKED (1<<20)
#define P2_SF2_WEAPONS_LOCKED (1<<21)
#define P2_SF2_SCRAMBLE_MESSAGES (1<<22)
+#define P2_OF_NO_COLLIDE (1<<23) // This actually changes the OF_COLLIDES object flag
// and again: these flags do not appear in the array
//#define blah (1<<28)
Index: code/object/collideshipship.cpp
===================================================================
--- code/object/collideshipship.cpp (revision 10966)
+++ code/object/collideshipship.cpp (working copy)
@@ -172,15 +172,6 @@
}
}
- // If either of these objects doesn't get collision checks, abort.
- if (heavy_sip->flags & SIF_NO_COLLIDE) {
- return 0;
- }
-
- if (light_sip->flags & SIF_NO_COLLIDE) {
- return 0;
- }
-
// Set up model_collide info
mc_info mc;
mc_info_init(&mc);
Index: code/object/collideshipweapon.cpp
===================================================================
--- code/object/collideshipweapon.cpp (revision 10966)
+++ code/object/collideshipweapon.cpp (working copy)
@@ -140,11 +140,7 @@
// Make ships that are warping in not get collision detection done
if ( shipp->flags & SF_ARRIVING ) return 0;
-
- // If either of these objects doesn't get collision checks, abort.
- if (Ship_info[shipp->ship_info_index].flags & SIF_NO_COLLIDE)
- return 0;
-
+
// Return information for AI to detect incoming fire.
// Could perhaps be done elsewhere at lower cost --MK, 11/7/97
float dist = vm_vec_dist_quick(&ship_objp->pos, &weapon_objp->pos);
Index: code/object/object.cpp
===================================================================
--- code/object/object.cpp (revision 10966)
+++ code/object/object.cpp (working copy)
@@ -104,6 +104,7 @@
{OF_LASER_PROTECTED, "laser-protect-ship", 1, },
{OF_MISSILE_PROTECTED, "missile-protect-ship", 1, },
{OF_IMMOBILE, "immobile", 1, },
+ {OF_COLLIDES, "collides", 1, },
};
// all we need to set are the pointers, but type, parent, and instance are useful to set as well
Index: code/object/object.h
===================================================================
--- code/object/object.h (revision 10966)
+++ code/object/object.h (working copy)
@@ -132,7 +132,7 @@
int flag_list;
} obj_flag_name;
-#define MAX_OBJECT_FLAG_NAMES 9
+#define MAX_OBJECT_FLAG_NAMES 10
extern obj_flag_name Object_flag_names[];
struct dock_instance;
Index: code/parse/sexp.cpp
===================================================================
--- code/parse/sexp.cpp (revision 10966)
+++ code/parse/sexp.cpp (working copy)
@@ -12807,9 +12807,9 @@
{
// set or clear?
if (set_flag)
- oswpt.objp->flags |= object_flag;
+ obj_set_flags(oswpt.objp, oswpt.objp->flags | object_flag);
else
- oswpt.objp->flags &= ~object_flag;
+ obj_set_flags(oswpt.objp, oswpt.objp->flags & ~object_flag);
}
// handle ETS when modifying shields
Index: code/ship/ship.cpp
===================================================================
--- code/ship/ship.cpp (revision 10966)
+++ code/ship/ship.cpp (working copy)
@@ -5138,6 +5138,11 @@
if (sip->flags & SIF_SHIP_CLASS_DONT_COLLIDE_INVIS)
shipp->flags2 |= SF2_DONT_COLLIDE_INVIS;
+ if (sip->flags & SIF_NO_COLLIDE)
+ obj_set_flags(objp, objp->flags & ~OF_COLLIDES);
+ else
+ obj_set_flags(objp, objp->flags | OF_COLLIDES);
+
if (sip->flags2 & SIF2_NO_ETS)
shipp->flags2 |= SF2_NO_ETS;
@@ -9423,10 +9428,10 @@
else if (sip_orig->flags & SIF_SHIP_CLASS_DONT_COLLIDE_INVIS) // changing FROM a don't-collide-invisible ship class
sp->flags2 &= ~SF2_DONT_COLLIDE_INVIS;
- if (sip->flags & SIF_NO_COLLIDE) // changing TO a no_collide ship
- Objects[sp->objnum].flags &= ~OF_COLLIDES;
- else if (sip_orig->flags & SIF_NO_COLLIDE) // changing FROM a no_collide ship
- Objects[sp->objnum].flags |= OF_COLLIDES;
+ if (sip->flags & SIF_NO_COLLIDE) // changing TO a no-collision ship class
+ objp->flags &= ~OF_COLLIDES;
+ else if (sip_orig->flags & SIF_NO_COLLIDE) // changing FROM a no-collision ship class
+ objp->flags |= OF_COLLIDES;
if (sip->flags2 & SIF2_NO_ETS)
sp->flags2 |= SF2_NO_ETS;
-
NoCollideTest.fs2 (4,180 bytes) 2014-08-04 15:48
-
missionparse.cpp.patch (509 bytes) 2014-08-10 13:50
Index: code/mission/missionparse.cpp
===================================================================
--- code/mission/missionparse.cpp (revision 10978)
+++ code/mission/missionparse.cpp (working copy)
@@ -2587,8 +2587,6 @@
// Make sure that the correct flag is set in any case
if (parse_flags2 & P2_OF_NO_COLLIDE)
obj_set_flags(objp, objp->flags & ~OF_COLLIDES);
- else
- obj_set_flags(objp, objp->flags | OF_COLLIDES);
}
void fix_old_special_explosions(p_object *p_objp, int variable_index)
|
---|