[colobot] 09/100: Fix crash on loading saves with produce()d objects (#765)

Didier Raboud odyx at moszumanska.debian.org
Thu Jun 1 18:10:14 UTC 2017


This is an automated email from the git hooks/post-receive script.

odyx pushed a commit to branch debian/master
in repository colobot.

commit 1b074bd94dc495fe3bd971c14c774f4386f193ef
Author: krzys-h <krzys_h at interia.pl>
Date:   Fri Nov 11 13:37:39 2016 +0100

    Fix crash on loading saves with produce()d objects (#765)
    
    Thanks @melex750!
---
 src/script/scriptfunc.cpp | 1 +
 1 file changed, 1 insertion(+)

diff --git a/src/script/scriptfunc.cpp b/src/script/scriptfunc.cpp
index 7f6cb97..1c1f985 100644
--- a/src/script/scriptfunc.cpp
+++ b/src/script/scriptfunc.cpp
@@ -1393,6 +1393,7 @@ bool CScriptFunctions::rProduce(CBotVar* var, CBotVar* result, int& exception, v
             CProgramStorageObject* programStorage = dynamic_cast<CProgramStorageObject*>(object);
             Program* program = programStorage->AddProgram();
             programStorage->ReadProgram(program, name2.c_str());
+            program->readOnly = true;
             program->filename = name;
             dynamic_cast<CProgrammableObject*>(object)->RunProgram(program);
         }

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-games/colobot.git



More information about the Pkg-games-commits mailing list