From 22c009ee457705277104fac5f4d267e640434b98 Mon Sep 17 00:00:00 2001 From: Travis Howell Date: Fri, 21 Sep 2007 01:20:22 +0000 Subject: Fix regression, when loading levels in mustard. svn-id: r28997 --- engines/scumm/he/script_v80he.cpp | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'engines/scumm/he/script_v80he.cpp') diff --git a/engines/scumm/he/script_v80he.cpp b/engines/scumm/he/script_v80he.cpp index d4a11240bd..be17bbe3df 100644 --- a/engines/scumm/he/script_v80he.cpp +++ b/engines/scumm/he/script_v80he.cpp @@ -410,16 +410,18 @@ void ScummEngine_v80he::o80_getFileSize() { if (!f) { Common::File *file = new Common::File(); file->open((const char *)filename, Common::File::kFileReadMode); - f = file; + if (!file->isOpen()) + delete f; + else + f = file; } if (!f) { push(-1); } else { push(f->size()); + delete f; } - - delete f; } void ScummEngine_v80he::o80_stringToInt() { -- cgit v1.2.3