From 93d79cb44371121a2c16b6164a2cce302afb26ba Mon Sep 17 00:00:00 2001 From: Karjala22 <78927981+Karjala22@users.noreply.github.com> Date: Fri, 18 Oct 2024 19:49:40 -0400 Subject: [PATCH 1/3] Adding MOD_CONF enhancements. --- TheForceEngine/TFE_A11y/accessibility.h | 4 + TheForceEngine/TFE_DarkForces/mission.cpp | 20 +- TheForceEngine/TFE_DarkForces/mission.h | 9 +- TheForceEngine/TFE_DarkForces/player.cpp | 271 ++++++++++++++++++++-- TheForceEngine/TFE_DarkForces/player.h | 2 +- TheForceEngine/TFE_Settings/settings.cpp | 112 +++++++++ TheForceEngine/TFE_Settings/settings.h | 75 ++++++ 7 files changed, 468 insertions(+), 25 deletions(-) diff --git a/TheForceEngine/TFE_A11y/accessibility.h b/TheForceEngine/TFE_A11y/accessibility.h index a19822e8a..0e1c0b4d8 100644 --- a/TheForceEngine/TFE_A11y/accessibility.h +++ b/TheForceEngine/TFE_A11y/accessibility.h @@ -73,4 +73,8 @@ namespace TFE_A11Y { bool cutsceneCaptionsEnabled(); // True if captions or subtitles are enabled for gameplay bool gameplayCaptionsEnabled(); + + // Helpers for External Use - this really should be in a separate file + string toUpper(string input); + string toLower(string input); } \ No newline at end of file diff --git a/TheForceEngine/TFE_DarkForces/mission.cpp b/TheForceEngine/TFE_DarkForces/mission.cpp index ac323e72f..9e8bbac13 100644 --- a/TheForceEngine/TFE_DarkForces/mission.cpp +++ b/TheForceEngine/TFE_DarkForces/mission.cpp @@ -443,7 +443,9 @@ namespace TFE_DarkForces reticle_enable(true); } s_flatLighting = JFALSE; - s_nightvisionActive = JFALSE; + // Note: I am not sure why this is there but it overrides all player settings + // By default the player load disables night vision so it won't carry over from previous maps. + // s_nightvisionActive = JFALSE; } } else // Loading from save. @@ -935,16 +937,16 @@ namespace TFE_DarkForces s_visionFxCountdown = 2; } - void disableNightvisionInternal() + void disableNightVisionInternal() { s_flatLighting = JFALSE; s_visionFxEndCountdown = 3; } - void disableNightvision() + void disableNightVision() { - disableNightvisionInternal(); - s_nightvisionActive = JFALSE; + disableNightVisionInternal(); + s_nightVisionActive = JFALSE; hud_sendTextMessage(9); } @@ -956,11 +958,11 @@ namespace TFE_DarkForces { hud_sendTextMessage(11); sound_play(s_nightVisionDeactiveSoundSource); - s_nightvisionActive = JFALSE; + s_nightVisionActive = JFALSE; return; } - s_nightvisionActive = JTRUE; + s_nightVisionActive = JTRUE; beginNightVision(16); hud_sendTextMessage(10); sound_play(s_nightVisionActiveSoundSource); @@ -1302,9 +1304,9 @@ namespace TFE_DarkForces } if (inputMapping_getActionState(IADF_NIGHT_VISION_TOG) == STATE_PRESSED && s_playerInfo.itemGoggles) { - if (s_nightvisionActive) + if (s_nightVisionActive) { - disableNightvision(); + disableNightVision(); } else { diff --git a/TheForceEngine/TFE_DarkForces/mission.h b/TheForceEngine/TFE_DarkForces/mission.h index 8b17fbfb4..27272dc90 100644 --- a/TheForceEngine/TFE_DarkForces/mission.h +++ b/TheForceEngine/TFE_DarkForces/mission.h @@ -29,11 +29,16 @@ namespace TFE_DarkForces void mission_pause(JBool pause); void setScreenFxLevels(s32 healthFx, s32 shieldFx, s32 flashFx); - void disableNightvisionInternal(); + void disableNightVisionInternal(); + + void enableMask(); + void enableCleats(); + void enableNightVision(); + void enableHeadlamp(); void disableMask(); void disableCleats(); - void disableNightvision(); + void disableNightVision(); void mission_render(s32 rendererIndex = 0, bool forceTextureUpdate = false); diff --git a/TheForceEngine/TFE_DarkForces/player.cpp b/TheForceEngine/TFE_DarkForces/player.cpp index a531931dc..ced10e682 100644 --- a/TheForceEngine/TFE_DarkForces/player.cpp +++ b/TheForceEngine/TFE_DarkForces/player.cpp @@ -202,7 +202,7 @@ namespace TFE_DarkForces JBool s_weaponFiringSec = JFALSE; JBool s_wearingCleats = JFALSE; JBool s_wearingGasmask = JFALSE; - JBool s_nightvisionActive = JFALSE; + JBool s_nightVisionActive = JFALSE; JBool s_headlampActive = JFALSE; JBool s_superCharge = JFALSE; JBool s_superChargeHud= JFALSE; @@ -447,6 +447,244 @@ namespace TFE_DarkForces s_playerInfo.maxWeapon = nextWpn; } } + + void player_handleLevelOverrides(ModSettingLevelOverride modLevelOverride) + { + // Handle Integer Overrides + std::map intMap = modLevelOverride.intOverrideMap; + + // Handle Ammo/Shields/Lives/Battery + if (intMap.find("energy") != intMap.end()) + { + s_playerInfo.ammoEnergy = pickup_addToValue(0, intMap["energy"], 999); + } + if (intMap.find("power") != intMap.end()) + { + s_playerInfo.ammoPower = pickup_addToValue(0, intMap["power"], 999); + } + if (intMap.find("plasma") != intMap.end()) + { + s_playerInfo.ammoPlasma = pickup_addToValue(0, intMap["plasma"], 999); + } + if (intMap.find("detonator") != intMap.end()) + { + s_playerInfo.ammoDetonator = pickup_addToValue(0, intMap["detonator"], 999); + } + if (intMap.find("shell") != intMap.end()) + { + s_playerInfo.ammoShell = pickup_addToValue(0, intMap["shell"], 999); + } + if (intMap.find("mine") != intMap.end()) + { + s_playerInfo.ammoMine = pickup_addToValue(0, intMap["mine"], 999); + } + if (intMap.find("missile") != intMap.end()) + { + s_playerInfo.ammoMissile = pickup_addToValue(0, intMap["missile"], 99); + } + if (intMap.find("shields") != intMap.end()) + { + s_playerInfo.shields = pickup_addToValue(0, intMap["shields"], 999); + } + if (intMap.find("health") != intMap.end()) + { + s_playerInfo.health = pickup_addToValue(0, intMap["health"], 999); + } + if (intMap.find("lives") != intMap.end()) + { + s_lifeCount = pickup_addToValue(0, intMap["lives"], 9); + } + if (intMap.find("battery") != intMap.end()) + { + fixed16_16 batteryPower = FIXED(2); + int batteryPowerPercent = pickup_addToValue(0, intMap["battery"], 100); + s_batteryPower = (batteryPower * batteryPowerPercent) / 100; + } + + // Note - this doesn't check if the weapon is is in the inventory! + if (intMap.find("defaultWeapon") != intMap.end()) + { + int weaponSwitchID = pickup_addToValue(0, intMap["defaultWeapon"], 9); + + // Map it to the weapon index on the KEYBOARD (Ex: 1 = fists, 2 = bryar etc..) + if (weaponSwitchID == 0) + { + player_setNextWeapon(9); + } + else + { + player_setNextWeapon(weaponSwitchID - 1); + } + } + + // Handle attenuation such as Gromas + if (intMap.find("fogLevel") != intMap.end()) + { + s_levelAtten = pickup_addToValue(0, intMap["fogLevel"], 100); + } + + // Handle Boolean Overrides + std::map boolMap = modLevelOverride.boolOverrideMap; + + // Handle Weapons + if (boolMap.find("pistol") != boolMap.end()) + { + s_playerInfo.itemPistol = boolMap["pistol"]; + } + if (boolMap.find("rifle") != boolMap.end()) + { + s_playerInfo.itemRifle = boolMap["rifle"]; + } + if (boolMap.find("autogun") != boolMap.end()) + { + s_playerInfo.itemAutogun = boolMap["autogun"]; + } + if (boolMap.find("mortar") != boolMap.end()) + { + s_playerInfo.itemMortar = boolMap["mortar"]; + } + if (boolMap.find("fusion") != boolMap.end()) + { + s_playerInfo.itemFusion = boolMap["fusion"]; + } + if (boolMap.find("concussion") != boolMap.end()) + { + s_playerInfo.itemConcussion = boolMap["concussion"]; + } + if (boolMap.find("cannon") != boolMap.end()) + { + s_playerInfo.itemCannon = boolMap["cannon"]; + } + + // Handle Activatable Items + + if (boolMap.find("mask") != boolMap.end()) + { + s_playerInfo.itemMask = boolMap["mask"]; + } + if (boolMap.find("goggles") != boolMap.end()) + { + s_playerInfo.itemGoggles = boolMap["goggles"]; + } + if (boolMap.find("cleats") != boolMap.end()) + { + s_playerInfo.itemCleats = boolMap["cleats"]; + } + + // Handle Items + + if (boolMap.find("plans") != boolMap.end()) + { + s_playerInfo.itemPlans = boolMap["plans"]; + } + if (boolMap.find("phrik") != boolMap.end()) + { + s_playerInfo.itemPhrik = boolMap["phrik"]; + } + if (boolMap.find("nava") != boolMap.end()) + { + s_playerInfo.itemNava = boolMap["nava"]; + } + if (boolMap.find("datatape") != boolMap.end()) + { + s_playerInfo.itemDatatape = boolMap["datatape"]; + } + if (boolMap.find("dtWeapon") != boolMap.end()) + { + s_playerInfo.itemDtWeapon = boolMap["dtWeapon"]; + } + if (boolMap.find("code1") != boolMap.end()) + { + s_playerInfo.itemCode1 = boolMap["code1"]; + } + if (boolMap.find("code2") != boolMap.end()) + { + s_playerInfo.itemCode2 = boolMap["code2"]; + } + if (boolMap.find("code3") != boolMap.end()) + { + s_playerInfo.itemCode3 = boolMap["code3"]; + } + if (boolMap.find("code4") != boolMap.end()) + { + s_playerInfo.itemCode4 = boolMap["code4"]; + } + if (boolMap.find("code5") != boolMap.end()) + { + s_playerInfo.itemCode5 = boolMap["code5"]; + } + + // Handle Keys + if (boolMap.find("redKey") != boolMap.end()) + { + s_playerInfo.itemRedKey = boolMap["redKey"]; + } + if (boolMap.find("yellowKey") != boolMap.end()) + { + s_playerInfo.itemYellowKey = boolMap["yellowKey"]; + } + if (boolMap.find("blueKey") != boolMap.end()) + { + s_playerInfo.itemBlueKey = boolMap["blueKey"]; + } + + // Enable Activatable items + + if (boolMap.find("enableMask") != boolMap.end()) + { + if (boolMap["enableMask"]) + { + s_playerInfo.itemMask = JTRUE; + enableMask(); + } + } + if (boolMap.find("enableCleats") != boolMap.end()) + { + if (boolMap["enableCleats"]) + { + s_playerInfo.itemCleats = JTRUE; + enableCleats(); + } + } + if (boolMap.find("enableNightVision") != boolMap.end()) + { + if (boolMap["enableNightVision"]) + { + s_playerInfo.itemGoggles = JTRUE; + enableNightVision(); + } + } + if (boolMap.find("enableHeadlamp") != boolMap.end()) + { + if (boolMap["enableHeadlamp"]) + { + enableHeadlamp(); + } + } + + // Wipe everything and start only with Bryar Pistol Only + + if (boolMap.find("bryarOnly") != boolMap.end() && boolMap["bryarOnly"] == MSO_TRUE) + { + + // Wipe the player inventory settings. + u8* src = (u8*)&s_playerInfo; + size_t size = (size_t)&s_playerInfo.pileSaveMarker - (size_t)&s_playerInfo; + assert(size == 140); + memset(src, 0, size); + + // Give player 100 blaster ammo and a Bryar Pistol + s_playerInfo.ammoEnergy = pickup_addToValue(0, 100, 999); + s_playerInfo.itemPistol = JTRUE; + player_setNextWeapon(1); + + // Disable all activatable items + disableMask(); + disableCleats(); + disableNightVision(); + hud_clearMessage(); + } + } void player_createController(JBool clearData) { @@ -550,13 +788,20 @@ namespace TFE_DarkForces s_wearingGasmask = JFALSE; s_wearingCleats = JFALSE; - s_nightvisionActive = JFALSE; + s_nightVisionActive = JFALSE; s_headlampActive = JFALSE; // Handle level-specific hacks. const char* levelName = agent_getLevelName(); TFE_System::logWrite(LOG_MSG, "Player", "Setting up level '%s'", levelName); - if (!strcasecmp(levelName, "jabship")) + + // Handle custom level player overrides + ModSettingLevelOverride modLevelOverride = TFE_Settings::getLevelOverrides(levelName); + if (!modLevelOverride.levName.empty()) + { + player_handleLevelOverrides(modLevelOverride); + } + else if (!strcasecmp(levelName, "jabship")) { u8* src = (u8*)&s_playerInfo; size_t size = (size_t)&s_playerInfo.pileSaveMarker - (size_t)&s_playerInfo; @@ -580,7 +825,7 @@ namespace TFE_DarkForces player_setNextWeapon(0); disableMask(); disableCleats(); - disableNightvision(); + disableNightVision(); hud_clearMessage(); } } @@ -1209,8 +1454,8 @@ namespace TFE_DarkForces player_revive(); player_reset(); s_headlampActive = JFALSE; - s_nightvisionActive = JFALSE; - disableNightvisionInternal(); + s_nightVisionActive = JFALSE; + disableNightVisionInternal(); s_playerObject->yaw = s_curSafe->yaw; s_playerYaw = s_curSafe->yaw; @@ -2259,7 +2504,7 @@ namespace TFE_DarkForces atten = max(headlamp, s_weaponLight + s_levelAtten); } s_baseAtten = atten; - if (s_nightvisionActive) + if (s_nightVisionActive) { atten = 0; } @@ -2440,17 +2685,17 @@ namespace TFE_DarkForces fixed16_16 powerDelta = mul16(GASMASK_ENERGY_CONSUMPTION, s_deltaTime); s_batteryPower -= powerDelta; } - if (s_nightvisionActive) + if (s_nightVisionActive) { fixed16_16 powerDelta = mul16(GOGGLES_ENERGY_CONSUMPTION, s_deltaTime); s_batteryPower -= powerDelta; } if (s_batteryPower <= 0) { - if (s_nightvisionActive) + if (s_nightVisionActive) { - s_nightvisionActive = JFALSE; - disableNightvisionInternal(); + s_nightVisionActive = JFALSE; + disableNightVisionInternal(); hud_sendTextMessage(9); } if (s_headlampActive) @@ -2920,7 +3165,7 @@ namespace TFE_DarkForces SERIALIZE(ObjState_InitVersion, s_weaponFiringSec, 0); SERIALIZE(ObjState_InitVersion, s_wearingCleats, 0); SERIALIZE(ObjState_InitVersion, s_wearingGasmask, 0); - SERIALIZE(ObjState_InitVersion, s_nightvisionActive, 0); + SERIALIZE(ObjState_InitVersion, s_nightVisionActive, 0); SERIALIZE(ObjState_InitVersion, s_headlampActive, 0); SERIALIZE(ObjState_InitVersion, s_superCharge, 0); SERIALIZE(ObjState_InitVersion, s_superChargeHud, 0); @@ -2965,7 +3210,7 @@ namespace TFE_DarkForces s_playerObject = playerObjId < 0 ? nullptr : objData_getObjectBySerializationId(playerObjId); s_playerEye = playerEyeId < 0 ? nullptr : objData_getObjectBySerializationId(playerEyeId); - if (s_nightvisionActive) + if (s_nightVisionActive) { TFE_Jedi::s_flatAmbient = 16; TFE_Jedi::s_flatLighting = JTRUE; diff --git a/TheForceEngine/TFE_DarkForces/player.h b/TheForceEngine/TFE_DarkForces/player.h index 692d1ab73..11eb02013 100644 --- a/TheForceEngine/TFE_DarkForces/player.h +++ b/TheForceEngine/TFE_DarkForces/player.h @@ -94,7 +94,7 @@ namespace TFE_DarkForces extern JBool s_weaponFiringSec; extern JBool s_wearingCleats; extern JBool s_wearingGasmask; - extern JBool s_nightvisionActive; + extern JBool s_nightVisionActive; extern JBool s_headlampActive; extern JBool s_superCharge; extern JBool s_superChargeHud; diff --git a/TheForceEngine/TFE_Settings/settings.cpp b/TheForceEngine/TFE_Settings/settings.cpp index 4acd94263..ef6e9ed02 100644 --- a/TheForceEngine/TFE_Settings/settings.cpp +++ b/TheForceEngine/TFE_Settings/settings.cpp @@ -7,6 +7,7 @@ #include #include #include +#include #include #include #include @@ -1313,6 +1314,18 @@ namespace TFE_Settings ////////////////////////////////////////////////// // Mod Settings/Overrides. ////////////////////////////////////////////////// + + ModSettingLevelOverride getLevelOverrides(string levelName) + { + string lowerLevel = TFE_A11Y::toLower(levelName); + if (s_modSettings.levelOverrides.find(lowerLevel) != s_modSettings.levelOverrides.end()) + { + return s_modSettings.levelOverrides[lowerLevel]; + } + ModSettingLevelOverride empty; + return empty; + } + ModSettingOverride parseJSonBoolToOverride(const cJSON* item) { ModSettingOverride value = MSO_NOT_SET; // default @@ -1331,6 +1344,31 @@ namespace TFE_Settings return value; } + int parseJSonIntToOverride(const cJSON* item) + { + int value = -1; // default is -1 + + // Check if it is a json numerical + if (cJSON_IsNumber(item)) + { + value = cJSON_GetNumberValue(item); + } + else + { + std::string valueString = item->valuestring; + if (valueString.find_first_not_of("0123456789") == string::npos) + { + value = std::stoi(valueString); + } + else + { + TFE_System::logWrite(LOG_WARNING, "MOD_CONF", "Override '%s' is an invalid type and should be an integer. Ignoring override.", item->string); + } + } + return value; + }; + + void parseTfeOverride(TFE_ModSettings* modSettings, const cJSON* tfeOverride) { if (!tfeOverride || !tfeOverride->string) { return; } @@ -1359,6 +1397,80 @@ namespace TFE_Settings { modSettings->normalFix3do = parseJSonBoolToOverride(tfeOverride); } + else if (strcasecmp(tfeOverride->string, "levelOverrides") == 0) + { + const cJSON* levelIter = tfeOverride->child; + if (!levelIter) + { + TFE_System::logWrite(LOG_WARNING, "MOD_CONF", "Level String is Empty", tfeOverride->string); + } + for (; levelIter; levelIter = levelIter->next) + { + if (!levelIter->string) + { + TFE_System::logWrite(LOG_WARNING, "MOD_CONF", "Level override for '%s' has no name, skipping.", levelIter->string); + continue; + } + else + { + + // Remove the .lev extension if it exists. + std::string levelName = TFE_A11Y::toLower(levelIter->string); + if (levelName.size() >= 4 && levelName.rfind(".lev") == (levelName.size() - 4)) { + levelName.erase(levelName.size() - 4, 4); + } + + ModSettingLevelOverride levelOverride; + levelOverride.levName = levelName; + + const cJSON* levelOverrideIter = levelIter->child; + for (; levelOverrideIter; levelOverrideIter = levelOverrideIter->next) + { + if (!levelOverrideIter->string) + { + TFE_System::logWrite(LOG_WARNING, "MOD_CONF", "Level override for '%s' has no name, skipping.", levelOverrideIter->string); + continue; + } + else + { + const char* overrideName = levelOverrideIter->string; + + // Check if it is an integer-type override + int intArraySize = sizeof(modIntOverrides) / sizeof(modIntOverrides[0]); + bool isIntParam = false; + for (int i = 0; i < intArraySize; ++i) { + if (strcmp(modIntOverrides[i], overrideName) == 0) { + + // Parse the integer value. + int jsonIntResult = parseJSonIntToOverride(levelOverrideIter); + if (jsonIntResult != -1) + { + levelOverride.intOverrideMap[overrideName] = jsonIntResult; + isIntParam = true; + break; + } + } + } + + // Skip checking if parameter is a boolean if it is of type integer. + if (isIntParam) { + continue; + } + + // Check if it is an bool-type override + int boolArraySize = sizeof(modBoolOverrides) / sizeof(modBoolOverrides[0]); + for (int i = 0; i < boolArraySize; ++i) { + if (strcmp(modBoolOverrides[i], overrideName) == 0) { + levelOverride.boolOverrideMap[overrideName] = parseJSonBoolToOverride(levelOverrideIter) == MSO_TRUE ? JTRUE : JFALSE; + break; + } + } + } + } + modSettings->levelOverrides[levelName] = levelOverride; + } + } + } } void parseJsonStringArray(const cJSON* item, std::vector& stringList) diff --git a/TheForceEngine/TFE_Settings/settings.h b/TheForceEngine/TFE_Settings/settings.h index b43b742cc..6a98abac9 100644 --- a/TheForceEngine/TFE_Settings/settings.h +++ b/TheForceEngine/TFE_Settings/settings.h @@ -13,6 +13,7 @@ #include #include #include "gameSourceData.h" +#include enum SkyMode { @@ -283,6 +284,76 @@ struct ModHdIgnoreList std::vector waxIgnoreList; }; +static const char* modIntOverrides[] = +{ + "energy", + "power", + "plasma", + "detonator", + "shell", + "mine", + "missile", + "shields", + "health", + "lives", + "battery", + + // Custom int overrides + "defaultWeapon", + "fogLevel" +}; + +// Boolean overrides for mod levels +static const char* modBoolOverrides[] = +{ + // Enable inventory items on start + "enableMask", + "enableCleats", + "enableNightVision", + "enableHeadlamp", + + // Add/Remove Weapons + "pistol", + "rifle", + "autogun", + "mortar", + "fusion", + "concussion", + "cannon", + + // Toggleable items + "mask", + "goggles", + "cleats", + + // Inventory items + "plans", + "phrik", + "datatape", + "nava", + "dtWeapon", + "code1", + "code2", + "code3", + "code4", + "code5", + + // Keys + "yellowKey", + "redKey", + "blueKey", + + // Resets everything to only use bryar like the first mission. + "bryarOnly" +}; + +struct ModSettingLevelOverride +{ + std::string levName; + std::map intOverrideMap = {}; + std::map boolOverrideMap = {}; +}; + struct TFE_ModSettings { ModSettingOverride ignoreInfLimits = MSO_NOT_SET; @@ -292,6 +363,7 @@ struct TFE_ModSettings ModSettingOverride ignore3doLimits = MSO_NOT_SET; ModSettingOverride normalFix3do = MSO_NOT_SET; + std::map levelOverrides; std::vector ignoreList; }; @@ -328,6 +400,9 @@ namespace TFE_Settings bool ignore3doLimits(); bool normalFix3do(); + // Settings for level mod overrides. + ModSettingLevelOverride getLevelOverrides(string levelName); + bool validatePath(const char* path, const char* sentinel); void autodetectGamePaths(); void clearModSettings(); From 7ac28f9b1932b2c723dec6fe50a238868e04af7e Mon Sep 17 00:00:00 2001 From: Karjala22 <78927981+Karjala22@users.noreply.github.com> Date: Fri, 18 Oct 2024 23:34:27 -0400 Subject: [PATCH 2/3] Add mod conf versioning --- TheForceEngine/TFE_Settings/settings.cpp | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/TheForceEngine/TFE_Settings/settings.cpp b/TheForceEngine/TFE_Settings/settings.cpp index ef6e9ed02..38708d547 100644 --- a/TheForceEngine/TFE_Settings/settings.cpp +++ b/TheForceEngine/TFE_Settings/settings.cpp @@ -41,6 +41,14 @@ namespace TFE_Settings static TFE_ModSettings s_modSettings = {}; static std::vector s_iniBuffer; + + //MOD CONF Version ENUM + enum ModConfVersion + { + MOD_CONF_INIT_VER = 0x00010000, + MOD_CONF_CUR_VERSION = MOD_CONF_INIT_VER + }; + enum SectionID { SECTION_WINDOW = 0, @@ -1534,6 +1542,17 @@ namespace TFE_Settings { if (!curElem->string) { continue; } + // Ensure the version is supported. + if (strcasecmp(curElem->string, "TFE_VERSION") == 0) + { + int modVersion = parseJSonIntToOverride(curElem); + if (modVersion < MOD_CONF_CUR_VERSION) + { + TFE_System::logWrite(LOG_WARNING, "MOD_CONF", "This MOD Conf version is not supported by this Force Engine release."); + return; + } + } + if (strcasecmp(curElem->string, "TFE_OVERRIDES") == 0 && cJSON_IsObject(curElem)) { const cJSON* iter = curElem->child; From c62030c44c2f4926f63cb643a34283187d8e339c Mon Sep 17 00:00:00 2001 From: Karjala22 <78927981+Karjala22@users.noreply.github.com> Date: Thu, 24 Oct 2024 17:04:00 -0400 Subject: [PATCH 3/3] is is fixed --- TheForceEngine/TFE_DarkForces/player.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/TheForceEngine/TFE_DarkForces/player.cpp b/TheForceEngine/TFE_DarkForces/player.cpp index ced10e682..704939ae8 100644 --- a/TheForceEngine/TFE_DarkForces/player.cpp +++ b/TheForceEngine/TFE_DarkForces/player.cpp @@ -501,7 +501,7 @@ namespace TFE_DarkForces s_batteryPower = (batteryPower * batteryPowerPercent) / 100; } - // Note - this doesn't check if the weapon is is in the inventory! + // Note - this doesn't check if the weapon is in the inventory! if (intMap.find("defaultWeapon") != intMap.end()) { int weaponSwitchID = pickup_addToValue(0, intMap["defaultWeapon"], 9);