Codechange: use std::string for getting a script's name
This commit is contained in:
@@ -97,12 +97,8 @@ void ScriptScanner::Reset()
|
||||
|
||||
void ScriptScanner::RegisterScript(ScriptInfo *info)
|
||||
{
|
||||
char script_original_name[1024];
|
||||
this->GetScriptName(info, script_original_name, lastof(script_original_name));
|
||||
strtolower(script_original_name);
|
||||
|
||||
char script_name[1024];
|
||||
seprintf(script_name, lastof(script_name), "%s.%d", script_original_name, info->GetVersion());
|
||||
std::string script_original_name = this->GetScriptName(info);
|
||||
std::string script_name = fmt::format("{}.{}", script_original_name, info->GetVersion());
|
||||
|
||||
/* Check if GetShortName follows the rules */
|
||||
if (strlen(info->GetShortName()) != 4) {
|
||||
|
@@ -99,7 +99,7 @@ protected:
|
||||
/**
|
||||
* Get the script name how to store the script in memory.
|
||||
*/
|
||||
virtual void GetScriptName(ScriptInfo *info, char *name, const char *last) = 0;
|
||||
virtual std::string GetScriptName(ScriptInfo *info) = 0;
|
||||
|
||||
/**
|
||||
* Get the filename to scan for this type of script.
|
||||
|
Reference in New Issue
Block a user