Commit d5f73857 authored by Gerhard Stein's avatar Gerhard Stein

Fixes and python3 is enabled back again :-)

parent 60c8c37b
......@@ -10,6 +10,8 @@ set (CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/CMake")
# Use compile time reducer
include(cotire)
option(USE_PYTHON3 "Use Python3 scripts" yes)
set (CMAKE_CXX_STANDARD 11)
#------------------------------------------------------------------------------
......
......@@ -2081,7 +2081,7 @@ void CPlayerLevel::openDoorsTile()
newY++;
next_tileno = mpMap->getPlaneDataAt(1, newX<<CSF, newY<<CSF);
//const int freeTileno = mp_Map->getPlaneDataAt(1, (newX+1)<<CSF, newY<<CSF);
//const int freeTileno = mpMap->getPlaneDataAt(1, (newX+1)<<CSF, newY<<CSF);
//const bool isBlock = tilePropVec[freeTileno].bup;
/*if( isBlock ) // Freeshot for some doors, which might have strange
......
......@@ -147,6 +147,8 @@ void CCouncilMember::getTouchedBy(CSpriteObject &theObject)
if(rescued)
return;
const auto curLevel = mpMap->getLevel();
// When Keen touches the Council Member exit the level and add one to the council list
if( CPlayerBase *player = dynamic_cast<CPlayerBase*>(&theObject) )
{
......@@ -177,17 +179,16 @@ void CCouncilMember::getTouchedBy(CSpriteObject &theObject)
{
customDlgs = true;
int level = mp_Map->getLevel();
bool ok = true;
ok &= loadStrFunction(pModule, "getMemberDialog", elder_text[0], level);
ok &= loadStrFunction(pModule, "getMemberAnswer", elder_text[1], level);
ok &= loadStrFunction(pModule, "getMemberDialog", elder_text[0], curLevel);
ok &= loadStrFunction(pModule, "getMemberAnswer", elder_text[1], curLevel);
}
#endif
if(!customDlgs)
{
if( mpMap->getLevel() == 17 ) // Under water the text is a bit different
if( curLevel == 17 ) // Under water the text is a bit different
{
elder_text[0] = gBehaviorEngine.getString("ELDERS_UNDERWATER_TEXT");
elder_text[1] = "";
......
......@@ -57,6 +57,8 @@ void CLindsey::getTouchedBy(CSpriteObject &theObject)
{
if(prepareToVanish)
return;
int curLevel = mpMap->getLevel();
// When Keen touches the pincess give that hint
if( dynamic_cast<CPlayerLevel*>(&theObject) )
......@@ -67,8 +69,7 @@ void CLindsey::getTouchedBy(CSpriteObject &theObject)
lindsey_text[0] = gBehaviorEngine.getString(answermap[0]);
Uint16 cur_level = mpMap->getLevel();
if(cur_level > 5)
if(curLevel > 5)
{
lindsey_text[1] = gBehaviorEngine.getString(answermap[1]);
lindsey_text[2] = gBehaviorEngine.getString(answermap[3]);
......@@ -94,10 +95,9 @@ void CLindsey::getTouchedBy(CSpriteObject &theObject)
{
customDlgs = true;
int level = mp_Map->getLevel();
bool ok = true;
ok &= loadStrFunction(pModule, "getLindseyDialog", lindsey_text[0], level);
ok &= loadStrFunction(pModule, "getLindseyAnswer", lindsey_text[1], level);
ok &= loadStrFunction(pModule, "getLindseyDialog", lindsey_text[0], curLevel);
ok &= loadStrFunction(pModule, "getLindseyAnswer", lindsey_text[1], curLevel);
}
#endif
......
......@@ -288,7 +288,7 @@ void CAmpton::processPoleSlide()
// Check for Floor here!
const int fall1 = mpMap->getPlaneDataAt(1, l_x, l_y_down+(1<<CSF));
//const int fall1 = mp_Map->getPlaneDataAt(1, l_x, l_y_down);
//const int fall1 = mpMap->getPlaneDataAt(1, l_x, l_y_down);
const CTileProperties &TileProp1 = gBehaviorEngine.getTileProperties(1)[fall1];
const bool leavePole = (TileProp1.bup != 0);
......
......@@ -45,7 +45,7 @@ bool CFuse::loadPythonScripts(const std::string &scriptBaseName)
#if USE_PYTHON3
auto pModule = gPython.loadModule( scriptBaseName, JoinPaths(gKeenFiles.gameDir ,"ai") );
const int level = mp_Map->getLevel();
const int level = mpMap->getLevel();
if (pModule != nullptr)
{
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment