(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:
rubidium
2013-06-27 19:57:41 +00:00
parent 8463335b00
commit 19eca468fc
9 changed files with 30 additions and 8 deletions

View File

@@ -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 &param_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));
}