[colobot] 45/377: Fixed calling not overriden methods in CBot

Didier Raboud odyx at moszumanska.debian.org
Wed Mar 30 13:33:56 UTC 2016


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

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

commit 2b03ed3a212eb8e9b16cecc3ecc4078c10d545b4
Author: melex750 <melex750 at users.noreply.github.com>
Date:   Sat Nov 21 13:27:40 2015 +0100

    Fixed calling not overriden methods in CBot
    
    see #540
---
 src/CBot/CBotClass.cpp | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/src/CBot/CBotClass.cpp b/src/CBot/CBotClass.cpp
index 3e1e007..bebd769 100644
--- a/src/CBot/CBotClass.cpp
+++ b/src/CBot/CBotClass.cpp
@@ -366,6 +366,14 @@ bool CBotClass::ExecuteMethode(long& nIdent, const char* name,
     if (ret>=0) return ret;
 
     ret = m_pMethod->DoCall(nIdent, name, pThis, ppParams, pStack, pToken, this);
+    if (ret >= 0) return ret;
+
+    if (m_pParent != nullptr)
+    {
+        ret = m_pParent->m_pCalls->DoCall(nIdent, name, pThis, ppParams, pResult, pStack, pToken);
+        if (ret >= 0) return ret;
+        ret = m_pParent->m_pMethod->DoCall(nIdent, name, pThis, ppParams, pStack, pToken, m_pParent);
+    }
     return ret;
 }
 

-- 
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