Reverted ScriptValue DataType from long to short (sync with 4.x)

Updated version number.
This commit is contained in:
NovaRain
2024-04-18 22:23:39 +08:00
parent 78ef06c8e6
commit 884c00ffeb
4 changed files with 9 additions and 8 deletions
+1 -1
View File
@@ -1,5 +1,5 @@
;sfall configuration settings ;sfall configuration settings
;v3.8.43 ;v3.8.43.1
[Main] [Main]
;Set to 1 if you want to use command line arguments to tell sfall to use another ini file ;Set to 1 if you want to use command line arguments to tell sfall to use another ini file
+5 -4
View File
@@ -188,7 +188,8 @@ void sArrayVar::clearAll()
void SaveArrayElement(sArrayElement* el, HANDLE h) void SaveArrayElement(sArrayElement* el, HANDLE h)
{ {
DWORD unused; DWORD unused;
WriteFile(h, &el->type, 4, &unused, 0); DWORD elType = static_cast<DWORD>(el->type); // for interoperability with older versions
WriteFile(h, &elType, 4, &unused, 0);
if (el->type == DATATYPE_STR) { if (el->type == DATATYPE_STR) {
WriteFile(h, &el->len, 4, &unused, 0); WriteFile(h, &el->len, 4, &unused, 0);
WriteFile(h, el->strVal, el->len, &unused, 0); WriteFile(h, el->strVal, el->len, &unused, 0);
@@ -199,9 +200,9 @@ void SaveArrayElement(sArrayElement* el, HANDLE h)
bool LoadArrayElement(sArrayElement* el, HANDLE h) bool LoadArrayElement(sArrayElement* el, HANDLE h)
{ {
DWORD unused; DWORD elType, unused;
ReadFile(h, &el->type, 4, &unused, 0); ReadFile(h, &elType, 4, &unused, 0);
el->type = (DataType)((DWORD)el->type & 0xFFFF); // fix for saved arrays from 4.4 el->type = static_cast<DataType>(elType & 0xFFFF); // for saved arrays from 4.4
if (el->type == DATATYPE_STR) { if (el->type == DATATYPE_STR) {
ReadFile(h, &el->len, 4, &unused, 0); ReadFile(h, &el->len, 4, &unused, 0);
if (el->len > 0) { if (el->len > 0) {
+1 -1
View File
@@ -25,7 +25,7 @@ namespace sfall
namespace script namespace script
{ {
enum DataType : unsigned long { enum DataType : unsigned short {
DATATYPE_NONE = 0, DATATYPE_NONE = 0,
DATATYPE_INT = 1, DATATYPE_INT = 1,
DATATYPE_FLOAT = 2, DATATYPE_FLOAT = 2,
+2 -2
View File
@@ -25,6 +25,6 @@
#define VERSION_MAJOR 3 #define VERSION_MAJOR 3
#define VERSION_MINOR 8 #define VERSION_MINOR 8
#define VERSION_BUILD 43 #define VERSION_BUILD 43
#define VERSION_REV 0 #define VERSION_REV 1
#define VERSION_STRING "3.8.43" #define VERSION_STRING "3.8.43.1"