diff --git a/artifacts/scripting/headers/sfall.h b/artifacts/scripting/headers/sfall.h index 1b7350ac..0738077b 100644 --- a/artifacts/scripting/headers/sfall.h +++ b/artifacts/scripting/headers/sfall.h @@ -220,7 +220,7 @@ // fake perks/traits add mode flags #define ADD_PERK_MODE_TRAIT (1) // add to the player's traits #define ADD_PERK_MODE_PERK (2) // add to the player's perks -#define ADD_PERK_MODE_REMOVE (4) // remove from the list of selectable perks +#define ADD_PERK_MODE_REMOVE (4) // remove from the list of selectable perks (after added to the player) // sfall_funcX macros #define add_global_timer_event(time, fixedParam) sfall_func2("add_g_timer_event", time, fixedParam) diff --git a/artifacts/scripting/sfall function notes.txt b/artifacts/scripting/sfall function notes.txt index 55628cb4..f7aefd73 100644 --- a/artifacts/scripting/sfall function notes.txt +++ b/artifacts/scripting/sfall function notes.txt @@ -606,6 +606,7 @@ optional arguments: > string sfall_func2("string_to_case", string text, int toCase) - converts all letters in the given string to the specified case - toCase: 0 - lowercase, 1 - uppercase +- NOTE: this function works only for English letters of A-Z/a-z ------------------------ ------ MORE INFO ------- diff --git a/sfall/HookScripts.cpp b/sfall/HookScripts.cpp index 2bcd877d..23a947ba 100644 --- a/sfall/HookScripts.cpp +++ b/sfall/HookScripts.cpp @@ -1770,7 +1770,7 @@ void HookScriptClear() { for (int i = 0; i < numHooks; i++) { hooks[i].clear(); } - memset(hooksInfo, 0, HOOK_COUNT * sizeof(HooksPositionInfo)); + std::memset(hooksInfo, 0, HOOK_COUNT * sizeof(HooksPositionInfo)); } void HookScriptInit() { diff --git a/sfall/Logging.cpp b/sfall/Logging.cpp index 1e2a0ec6..4246412a 100644 --- a/sfall/Logging.cpp +++ b/sfall/Logging.cpp @@ -34,6 +34,7 @@ void dlog(const char* a, int type) { Log.flush(); } } + void dlogr(const char* a, int type) { if (isDebug && (type == DL_MAIN || (type & DebugTypes))) { Log << a << "\n"; diff --git a/sfall/ScriptOps/ScriptUtils.hpp b/sfall/ScriptOps/ScriptUtils.hpp index 5a184c48..e323cb9b 100644 --- a/sfall/ScriptOps/ScriptUtils.hpp +++ b/sfall/ScriptOps/ScriptUtils.hpp @@ -1003,10 +1003,7 @@ static std::string strToCase; static void sf_string_to_case() { strToCase = opHandler.arg(0).strValue(); - if (opHandler.arg(1).rawValue()) - std::transform(strToCase.begin(), strToCase.end(), strToCase.begin(), ::toupper); - else - std::transform(strToCase.begin(), strToCase.end(), strToCase.begin(), ::tolower); + std::transform(strToCase.begin(), strToCase.end(), strToCase.begin(), opHandler.arg(1).rawValue() ? ::toupper : ::tolower); opHandler.setReturn(strToCase.c_str()); }