From 9d9bf4a3b22d0e41dc8c496a097007b42ef81333 Mon Sep 17 00:00:00 2001 From: NovaRain Date: Tue, 22 May 2018 20:49:45 +0800 Subject: [PATCH] Fixed the argument of how_much and enabled support for ceil math function. Added VS2010 project files. Tweaked CMap.h for the compatibility of VS2008. --- Hacks/CMap.h | 2 +- OpcodeAttributes.cpp | 4 +- Utility.cpp | 20 ++--- int2ssl.sln | 23 ++++++ int2ssl.vcxproj | 177 ++++++++++++++++++++++++++++++++++++++++ int2ssl.vcxproj.filters | 96 ++++++++++++++++++++++ 6 files changed, 309 insertions(+), 13 deletions(-) create mode 100644 int2ssl.sln create mode 100644 int2ssl.vcxproj create mode 100644 int2ssl.vcxproj.filters diff --git a/Hacks/CMap.h b/Hacks/CMap.h index 69b911a..5cb02cc 100644 --- a/Hacks/CMap.h +++ b/Hacks/CMap.h @@ -42,7 +42,7 @@ class CMap { if (_map.find(offset) != _map.end()) { - _map.at(offset) = value; + _map.find(offset)->second = value; } _map.insert(std::pair(offset, value)); diff --git a/OpcodeAttributes.cpp b/OpcodeAttributes.cpp index 0701baa..280bb51 100644 --- a/OpcodeAttributes.cpp +++ b/OpcodeAttributes.cpp @@ -260,7 +260,7 @@ COpcode::CF2OpcodeAttributesMap::CF2OpcodeAttributesMap() SetAt(O_DO_CHECK, COpcodeAttributes("O_DO_CHECK", "do_check", 3, expression)); SetAt(O_IS_SUCCESS, COpcodeAttributes("O_IS_SUCCESS", "is_success", 1, expression)); SetAt(O_IS_CRITICAL, COpcodeAttributes("O_IS_CRITICAL", "is_critical", 1, expression)); - SetAt(O_HOW_MUCH, COpcodeAttributes("O_HOW_MUCH", "how_much", 0, expression)); + SetAt(O_HOW_MUCH, COpcodeAttributes("O_HOW_MUCH", "how_much", 1, expression)); SetAt(O_MARK_AREA_KNOWN, COpcodeAttributes("O_MARK_AREA_KNOWN", "mark_area_known", 3)); SetAt(O_REACTION_INFLUENCE, COpcodeAttributes("O_REACTION_INFLUENCE", "reaction_influence", 3, expression)); SetAt(O_RANDOM, COpcodeAttributes("O_RANDOM", "random", 2, expression)); @@ -757,7 +757,7 @@ COpcode::CF2OpcodeAttributesMap::CF2OpcodeAttributesMap() SetAt(O_TS_TYPEOF, COpcodeAttributes("O_TS_TYPEOF", "typeof", 1, expression)); SetAt(O_TS_LOG, COpcodeAttributes("O_TS_LOG", "log", 1, expression)); // sfall 3.5 SetAt(O_TS_EXP, COpcodeAttributes("O_TS_EXP", "exponent", 1, expression)); // sfall 3.5 - //SetAt(O_TS_CEIL, COpcodeAttributes("O_TS_CEIL", "ceil", 1, expression)); + SetAt(O_TS_CEIL, COpcodeAttributes("O_TS_CEIL", "ceil", 1, expression)); // sfall 3.5 SetAt(O_TS_ROUND, COpcodeAttributes("O_TS_ROUND", "round", 1, expression)); // sfall 3.5 SetAt(O_TS_SAVE_ARRAY, COpcodeAttributes("O_TS_SAVE_ARRAY", "save_array", 2)); SetAt(O_TS_LOAD_ARRAY, COpcodeAttributes("O_TS_LOAD_ARRAY", "load_array", 1, expression)); diff --git a/Utility.cpp b/Utility.cpp index 60421fb..c32f901 100644 --- a/Utility.cpp +++ b/Utility.cpp @@ -54,18 +54,18 @@ std::string escape_str(std::string input) for (std::string::size_type i = 0; i < input.length(); ++i) { switch (input[i]) - { - case '\n': - output += "\\n"; - break; + { + case '\n': + output += "\\n"; + break; - case '\r': - output += "\\r"; - break; + case '\r': + output += "\\r"; + break; - default: - output += input[i]; - break;; + default: + output += input[i]; + break; } } return output; diff --git a/int2ssl.sln b/int2ssl.sln new file mode 100644 index 0000000..2404b31 --- /dev/null +++ b/int2ssl.sln @@ -0,0 +1,23 @@ + +Microsoft Visual Studio Solution File, Format Version 11.00 +# Visual Studio 2010 +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "int2ssl", "int2ssl.vcxproj", "{111A0D20-3404-449D-A984-73C3D9A001E1}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Win32 = Debug|Win32 + Release|Win32 = Release|Win32 + Win2K|Win32 = Win2K|Win32 + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {111A0D20-3404-449D-A984-73C3D9A001E1}.Debug|Win32.ActiveCfg = Debug|Win32 + {111A0D20-3404-449D-A984-73C3D9A001E1}.Debug|Win32.Build.0 = Debug|Win32 + {111A0D20-3404-449D-A984-73C3D9A001E1}.Release|Win32.ActiveCfg = Release|Win32 + {111A0D20-3404-449D-A984-73C3D9A001E1}.Release|Win32.Build.0 = Release|Win32 + {111A0D20-3404-449D-A984-73C3D9A001E1}.Win2K|Win32.ActiveCfg = Win2K|Win32 + {111A0D20-3404-449D-A984-73C3D9A001E1}.Win2K|Win32.Build.0 = Win2K|Win32 + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection +EndGlobal diff --git a/int2ssl.vcxproj b/int2ssl.vcxproj new file mode 100644 index 0000000..03f1b28 --- /dev/null +++ b/int2ssl.vcxproj @@ -0,0 +1,177 @@ + + + + + Debug + Win32 + + + Release + Win32 + + + Win2K + Win32 + + + + {111A0D20-3404-449D-A984-73C3D9A001E1} + int2ssl + + + + Application + true + MultiByte + v100 + + + Application + false + true + MultiByte + v100 + + + Application + false + true + MultiByte + v90 + + + + + + + + + + + + + + + + Debug\ + + + Debug\ + false + + + Release\ + + + Win2K\ + + + Release\ + false + false + + + Win2K\ + false + false + + + + Level3 + Disabled + EditAndContinue + WIN32;_DEBUG;_CONSOLE;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions) + true + EnableFastChecks + MultiThreadedDebugDLL + + + true + $(TargetPath) + $(OutDir)int2ssl.pdb + Console + MachineX86 + false + kernel32.lib + + + + + Level3 + Full + true + true + ProgramDatabase + true + WIN32;NDEBUG;_CONSOLE;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions) + true + MultiThreaded + + + true + true + true + $(TargetPath) + Console + UseLinkTimeCodeGeneration + MachineX86 + false + kernel32.lib + + + + + Level3 + Full + true + true + ProgramDatabase + true + WIN32;NDEBUG;_CONSOLE;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions) + true + MultiThreaded + + + true + true + true + $(TargetPath) + Console + UseLinkTimeCodeGeneration + MachineX86 + false + kernel32.lib + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/int2ssl.vcxproj.filters b/int2ssl.vcxproj.filters new file mode 100644 index 0000000..5434889 --- /dev/null +++ b/int2ssl.vcxproj.filters @@ -0,0 +1,96 @@ + + + + + {4FC737F1-C7A5-4376-A066-2A32D752A2FF} + cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx + + + {93995380-89BD-4b04-88EB-625FBE52EBFB} + h;hpp;hxx;hm;inl;inc;xsd + + + {67DA6AB6-F800-4c08-8B7A-83BB121AAD01} + rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms + + + {e9afbbab-60f2-40b9-a1ff-859a3bf8248a} + + + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + + + Header Files\Hacks + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + \ No newline at end of file