mirror of
https://github.com/sfall-team/sfall.git
synced 2026-07-27 16:52:34 -07:00
Code correction regarding string length
This commit is contained in:
+1
-1
@@ -3628,7 +3628,7 @@ void BugFixes_Init()
|
||||
// up an item due to not enough space in the inventory
|
||||
HookCall(0x49B6E7, obj_pickup_hook);
|
||||
HookCall(0x49B71C, obj_pickup_hook_message);
|
||||
Translate_Get("sfall", "NPCPickupFail", "%s cannot pick up the item.", pickupMessage, 64);
|
||||
Translate_Get("sfall", "NPCPickupFail", "%s cannot pick up the item.", pickupMessage, 65);
|
||||
|
||||
// Fix for anim_move_to_tile_ engine function ignoring the distance argument for the player
|
||||
HookCall(0x416D44, anim_move_to_tile_hook);
|
||||
|
||||
@@ -23,7 +23,7 @@
|
||||
|
||||
#include "ScriptExtender.h"
|
||||
|
||||
static char mapName[65] = {};
|
||||
static char mapName[17] = {};
|
||||
static char patchName[65] = {};
|
||||
static char versionString[65] = {};
|
||||
|
||||
@@ -711,19 +711,19 @@ static void EngineOptimizationPatches() {
|
||||
void MiscPatches_Init() {
|
||||
EngineOptimizationPatches();
|
||||
|
||||
if (GetConfigString("Misc", "StartingMap", "", mapName, 64)) {
|
||||
if (GetConfigString("Misc", "StartingMap", "", mapName, 17)) {
|
||||
dlog("Applying starting map patch.", DL_INIT);
|
||||
SafeWrite32(0x480AAA, (DWORD)&mapName);
|
||||
dlogr(" Done", DL_INIT);
|
||||
}
|
||||
|
||||
if (GetConfigString("Misc", "VersionString", "", versionString, 64)) {
|
||||
if (GetConfigString("Misc", "VersionString", "", versionString, 65)) {
|
||||
dlog("Applying version string patch.", DL_INIT);
|
||||
SafeWrite32(0x4B4588, (DWORD)&versionString);
|
||||
dlogr(" Done", DL_INIT);
|
||||
}
|
||||
|
||||
if (GetConfigString("Misc", "PatchFile", "", patchName, 64)) {
|
||||
if (GetConfigString("Misc", "PatchFile", "", patchName, 65)) {
|
||||
dlog("Applying patch file patch.", DL_INIT);
|
||||
SafeWrite32(0x444323, (DWORD)&patchName);
|
||||
dlogr(" Done", DL_INIT);
|
||||
|
||||
@@ -27,24 +27,24 @@ static char startFemaleModelName[65] = {};
|
||||
char defaultFemaleModelName[65] = {};
|
||||
|
||||
void PlayerModel_Init() {
|
||||
if (GetConfigString("Misc", "MaleStartModel", "", startMaleModelName, 64)) {
|
||||
if (GetConfigString("Misc", "MaleStartModel", "", startMaleModelName, 65)) {
|
||||
dlog("Applying male start model patch.", DL_INIT);
|
||||
SafeWrite32(0x418B88, (DWORD)&startMaleModelName);
|
||||
dlogr(" Done", DL_INIT);
|
||||
}
|
||||
|
||||
if (GetConfigString("Misc", "FemaleStartModel", "", startFemaleModelName, 64)) {
|
||||
if (GetConfigString("Misc", "FemaleStartModel", "", startFemaleModelName, 65)) {
|
||||
dlog("Applying female start model patch.", DL_INIT);
|
||||
SafeWrite32(0x418BAB, (DWORD)&startFemaleModelName);
|
||||
dlogr(" Done", DL_INIT);
|
||||
}
|
||||
|
||||
GetConfigString("Misc", "MaleDefaultModel", "hmjmps", defaultMaleModelName, 64);
|
||||
GetConfigString("Misc", "MaleDefaultModel", "hmjmps", defaultMaleModelName, 65);
|
||||
dlog("Applying male model patch.", DL_INIT);
|
||||
SafeWrite32(0x418B50, (DWORD)&defaultMaleModelName);
|
||||
dlogr(" Done", DL_INIT);
|
||||
|
||||
GetConfigString("Misc", "FemaleDefaultModel", "hfjmps", defaultFemaleModelName, 64);
|
||||
GetConfigString("Misc", "FemaleDefaultModel", "hfjmps", defaultFemaleModelName, 65);
|
||||
dlog("Applying female model patch.", DL_INIT);
|
||||
SafeWrite32(0x418B6D, (DWORD)&defaultFemaleModelName);
|
||||
dlogr(" Done", DL_INIT);
|
||||
|
||||
+2
-5
@@ -16,7 +16,6 @@
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#include "FalloutEngine.h"
|
||||
#include "IniReader.h"
|
||||
|
||||
#include "Translate.h"
|
||||
@@ -46,14 +45,12 @@ std::vector<std::string> Translate_GetList(const char* section, const char* sett
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
static void MakeLangTranslationPath(const char* config) {
|
||||
char patches[65], language[42];
|
||||
char patches[65], language[41];
|
||||
char fileConfig[65] = ".\\";
|
||||
|
||||
if (config[0] == '\0') config = (const char*)FO_VAR_fallout_config;
|
||||
std::strcpy(&fileConfig[2], config);
|
||||
|
||||
IniGetString("system", "language", "english", language, 41, fileConfig);
|
||||
IniGetString("system", "master_patches", "data", patches, 64, fileConfig);
|
||||
IniGetString("system", "master_patches", "data", patches, 65, fileConfig);
|
||||
|
||||
const char* iniDef = translationIni.def;
|
||||
while (*iniDef == '\\' || *iniDef == '/' || *iniDef == '.') iniDef++; // skip first characters
|
||||
|
||||
+4
-1
@@ -421,11 +421,14 @@ defaultIni:
|
||||
|
||||
IniReader_Init();
|
||||
|
||||
if (GetConfigString("Misc", "ConfigFile", "", falloutConfigName, 64)) {
|
||||
if (GetConfigString("Misc", "ConfigFile", "", falloutConfigName, 65)) {
|
||||
dlog("Applying config file patch.", DL_INIT);
|
||||
const DWORD configFileAddr[] = {0x444BA5, 0x444BCA};
|
||||
SafeWriteBatch<DWORD>((DWORD)&falloutConfigName, configFileAddr);
|
||||
dlogr(" Done", DL_INIT);
|
||||
} else {
|
||||
// if the ConfigFile is not assigned a value
|
||||
std::strcpy(falloutConfigName, (const char*)FO_VAR_fallout_config);
|
||||
}
|
||||
|
||||
Translate_Init(falloutConfigName);
|
||||
|
||||
Reference in New Issue
Block a user