diff --git a/redalert/building.cpp b/redalert/building.cpp index 7a4ba28c..81892272 100644 --- a/redalert/building.cpp +++ b/redalert/building.cpp @@ -5268,7 +5268,7 @@ bool BuildingClass::Can_Player_Move(void) const assert(Buildings.ID(this) == ID); assert(IsActive); - return (*this == STRUCT_CONST && (Mission == MISSION_GUARD) && Special.IsMCVDeploy); + return (*this == STRUCT_CONST && (Mission == MISSION_GUARD) && Is_MCV_Deploy()); } /*********************************************************************************************** diff --git a/redalert/cell.cpp b/redalert/cell.cpp index b4ce29c9..237c6405 100644 --- a/redalert/cell.cpp +++ b/redalert/cell.cpp @@ -2183,8 +2183,6 @@ long CellClass::Tiberium_Adjust(bool pregame) return (0); } -extern bool MPSuperWeaponDisable; - /*********************************************************************************************** * CellClass::Goodie_Check -- Performs crate discovery logic. * * * @@ -2319,7 +2317,7 @@ bool CellClass::Goodie_Check(FootClass* object) case CRATE_SONAR: if (Session.Type != GAME_NORMAL) { #ifdef REMASTER_BUILD - if (MPSuperWeaponDisable) { + if (!Rule.AllowSuperWeapons) { powerup = CRATE_MONEY; } #endif diff --git a/redalert/dllinterface.cpp b/redalert/dllinterface.cpp index 1d45ba2a..9b13160d 100644 --- a/redalert/dllinterface.cpp +++ b/redalert/dllinterface.cpp @@ -874,7 +874,7 @@ extern "C" __declspec(dllexport) bool __cdecl CNC_Set_Multiplayer_Data(int scena Special.IsMCVDeploy = game_options.IsMCVDeploy; Special.UseMCVDeploy = true; - MPSuperWeaponDisable = !game_options.EnableSuperweapons; // Are superweapons available + Rule.AllowSuperWeapons = game_options.EnableSuperweapons; // Are superweapons available // Session.Options.AIPlayers = WWGetPrivateProfileInt("Options", "AI", 0, buffer); //Number of AI players @@ -8581,7 +8581,7 @@ bool DLLExportClass::Save(Pipe& pipe) /* ** Special case for MPSuperWeaponDisable - store negated value so it defaults to enabled */ - bool not_allow_super_weapons = !MPSuperWeaponDisable; + bool not_allow_super_weapons = !Rule.AllowSuperWeapons; pipe.Put(¬_allow_super_weapons, sizeof(not_allow_super_weapons)); /* @@ -8683,7 +8683,7 @@ bool DLLExportClass::Load(Straw& file) if (file.Get(¬_allow_super_weapons, sizeof(not_allow_super_weapons)) != sizeof(not_allow_super_weapons)) { return false; } - MPSuperWeaponDisable = !not_allow_super_weapons; + Rule.AllowSuperWeapons = !not_allow_super_weapons; unsigned char padding[4095]; diff --git a/redalert/house.cpp b/redalert/house.cpp index b38957a4..e880a784 100644 --- a/redalert/house.cpp +++ b/redalert/house.cpp @@ -953,7 +953,6 @@ void HouseClass::Init(void) // Object selection list is switched with player context for GlyphX. ST - 8/7/2019 10:11AM extern void Logic_Switch_Player_Context(HouseClass* house); -extern bool MPSuperWeaponDisable; /*********************************************************************************************** * HouseClass::AI -- Process house logic. * @@ -1225,7 +1224,7 @@ void HouseClass::AI(void) ** Process any super weapon logic required. */ #ifdef REMASTER_BUILD - if (Session.Type != GAME_GLYPHX_MULTIPLAYER || !MPSuperWeaponDisable) { + if (Session.Type != GAME_GLYPHX_MULTIPLAYER || Rule.AllowSuperWeapons) { Super_Weapon_Handler(); } #else diff --git a/redalert/infantry.cpp b/redalert/infantry.cpp index dee22137..b75d52ab 100644 --- a/redalert/infantry.cpp +++ b/redalert/infantry.cpp @@ -588,8 +588,6 @@ void InfantryClass::Draw_It(int x, int y, WindowNumberType window) const FootClass::Draw_It(x, y, window); } -extern bool MPSuperWeaponDisable; - /*********************************************************************************************** * InfantryClass::Per_Cell_Process -- Handles special operations that occur once per cell. * * * @@ -704,7 +702,7 @@ void InfantryClass::Per_Cell_Process(PCPType why) tech->House->RadarSpied |= housespy; } #ifdef REMASTER_BUILD - if (Session.Type == GAME_NORMAL || !MPSuperWeaponDisable) { + if (Session.Type == GAME_NORMAL || Rule.AllowSuperWeapons) { #else if (Session.Type == GAME_NORMAL) { #endif diff --git a/redalert/rules.cpp b/redalert/rules.cpp index 544c0aca..25f5701f 100644 --- a/redalert/rules.cpp +++ b/redalert/rules.cpp @@ -267,6 +267,7 @@ RulesClass::RulesClass(void) , TiberiumLongScan(0x2000) , HealthBarDisplayMode(HB_SELECTED) , ResourceBarDisplayMode(RB_SELECTED) + , AllowSuperWeapons(true) { #ifdef FIXIT_CSII // checked - ajw 9/28/98 NewUnitsEnabled = SecretUnitsEnabled = false; diff --git a/redalert/rules.h b/redalert/rules.h index 7deef1ee..af2377c2 100644 --- a/redalert/rules.h +++ b/redalert/rules.h @@ -886,6 +886,11 @@ class RulesClass RB_SELECTED = 0, RB_ALWAYS, } ResourceBarDisplayMode; + + /* + ** Are superweapons allowed? + */ + bool AllowSuperWeapons; }; #endif \ No newline at end of file