From ed635a5b01f62497ecf064a330c93b478ea9dea1 Mon Sep 17 00:00:00 2001 From: lolbot-iichan Date: Sat, 29 Jun 2019 16:58:45 +0300 Subject: WINTERMUTE: Fix File.WriteText method Removed unnecessary '\0' byte written after a string. Reasons to remove: 1. Hamlet game does not write 0 after string when running this code: var SomeFile = new File((Game.SaveDirectory + "\gamelet.save")); SomeFile.OpenAsText(2); SomeFile.WriteText(LVL_N); SomeFile.Close(); 2. Original WME does not have this: https://github.com/retrowork/Wintermute-Engine/blob/master/src/engine_core/wme_base/SXFile.cpp#L303 --- engines/wintermute/base/scriptables/script_ext_file.cpp | 1 - 1 file changed, 1 deletion(-) (limited to 'engines/wintermute/base/scriptables') diff --git a/engines/wintermute/base/scriptables/script_ext_file.cpp b/engines/wintermute/base/scriptables/script_ext_file.cpp index daded7057c..a9e2c8ccdd 100644 --- a/engines/wintermute/base/scriptables/script_ext_file.cpp +++ b/engines/wintermute/base/scriptables/script_ext_file.cpp @@ -346,7 +346,6 @@ bool SXFile::scCallMethod(ScScript *script, ScStack *stack, ScStack *thisStack, writeLine = Common::String::format("%s", line); } _writeFile->writeString(writeLine); - _writeFile->writeByte(0); stack->pushBool(true); return STATUS_OK; -- cgit v1.2.3