Skip to content

Commit 6e7128f

Browse files
authored
Mod setting to disable shield effects (#6746)
Mods like FotG do not use the FS style shield hit effects, and simply disabling the shield rendering and checking is useful with one simple global variable. Tested and works as expected.
1 parent 921c597 commit 6e7128f

File tree

3 files changed

+12
-5
lines changed

3 files changed

+12
-5
lines changed

code/mod_table/mod_table.cpp

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -154,6 +154,7 @@ bool Countermeasures_use_capacity;
154154
bool Play_thruster_sounds_for_player;
155155
std::array<std::tuple<float, float>, 6> Fred_spacemouse_nonlinearity;
156156
bool Randomize_particle_rotation;
157+
bool Disable_shield_effects;
157158
bool Calculate_subsystem_hitpoints_after_parsing;
158159
bool Disable_internal_loadout_restoration_system;
159160
bool Contrails_use_absolute_speed;
@@ -980,6 +981,10 @@ void parse_mod_table(const char *filename)
980981
stuff_boolean(&Randomize_particle_rotation);
981982
}
982983

984+
if (optional_string("$Disable shield effects:")) {
985+
stuff_boolean(&Disable_shield_effects);
986+
}
987+
983988
optional_string("#NETWORK SETTINGS");
984989

985990
if (optional_string("$FS2NetD port:")) {
@@ -1732,6 +1737,7 @@ void mod_table_reset()
17321737
std::tuple<float, float>{ 1.0f, 1.0f }
17331738
}};
17341739
Randomize_particle_rotation = false;
1740+
Disable_shield_effects = false;
17351741
Calculate_subsystem_hitpoints_after_parsing = false;
17361742
Disable_internal_loadout_restoration_system = false;
17371743
Contrails_use_absolute_speed = false;

code/mod_table/mod_table.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -169,6 +169,7 @@ extern bool Countermeasures_use_capacity;
169169
extern bool Play_thruster_sounds_for_player;
170170
extern std::array<std::tuple<float, float>, 6> Fred_spacemouse_nonlinearity;
171171
extern bool Randomize_particle_rotation;
172+
extern bool Disable_shield_effects;
172173
extern bool Calculate_subsystem_hitpoints_after_parsing;
173174
extern bool Disable_internal_loadout_restoration_system;
174175
extern bool Contrails_use_absolute_speed;

code/ship/shield.cpp

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -546,7 +546,7 @@ void render_shields()
546546

547547
int i;
548548

549-
if (Detail.shield_effects == 0){
549+
if (Detail.shield_effects == 0 || Disable_shield_effects) {
550550
return; // No shield effect rendered at lowest detail level.
551551
}
552552

@@ -870,16 +870,16 @@ void shield_point_multi_setup()
870870
*/
871871
void create_shield_explosion_all(object *objp)
872872
{
873+
if (Detail.shield_effects == 0 || Disable_shield_effects) {
874+
return;
875+
}
876+
873877
int i;
874878
int num;
875879
int count;
876880
int objnum;
877881
ship *shipp;
878882

879-
if (Detail.shield_effects == 0){
880-
return;
881-
}
882-
883883
num = objp->instance;
884884
shipp = &Ships[num];
885885

0 commit comments

Comments
 (0)