(svn r25488) -Fix [FS#5613]: do not send encoded texts to names, but decode them into a plain C string and then pass them on
This commit is contained in:
@@ -11,9 +11,12 @@
|
||||
|
||||
#include "../../stdafx.h"
|
||||
#include "../../string_func.h"
|
||||
#include "../../strings_func.h"
|
||||
#include "script_text.hpp"
|
||||
#include "../../table/control_codes.h"
|
||||
|
||||
#include "table/strings.h"
|
||||
|
||||
ScriptText::ScriptText(HSQUIRRELVM vm) :
|
||||
ZeroedMemoryAllocator()
|
||||
{
|
||||
@@ -191,3 +194,13 @@ char *ScriptText::_GetEncodedText(char *p, char *lastofp, int ¶m_count)
|
||||
|
||||
return p;
|
||||
}
|
||||
|
||||
const char *Text::GetDecodedText()
|
||||
{
|
||||
const char *encoded_text = this->GetEncodedText();
|
||||
if (encoded_text == NULL) return NULL;
|
||||
|
||||
static char buf[1024];
|
||||
::SetDParamStr(0, encoded_text);
|
||||
return ::GetString(buf, STR_JUST_RAW_STRING, lastof(buf));
|
||||
}
|
||||
|
Reference in New Issue
Block a user