Commit d3178217 authored by Gerhard Stein's avatar Gerhard Stein

Swimming State of Player in Episode 4 correctly saved now and also the

item swim suit is correct stored
parent 77894eed
......@@ -416,7 +416,7 @@ void CPlayerWM::processMoving()
return;
}
}
else if(m_basesprite == swimBaseFrame)
else if( isSwimming() )
{
if(m_Inventory.Item.m_special.ep4.swimsuit)
{
......@@ -1050,44 +1050,44 @@ void CPlayerWM::checkforSwimming(bool &bleft, bool &bright, bool &bup, bool &bdo
if(up == 11)
{
bdown = true;
m_basesprite = swimBaseFrame;
makeHimSwim(true);
}
else if(down == 11)
{
m_basesprite = walkBaseFrame;
makeHimSwim(false);
}
// from right
if(right == 12)
{
bleft = true;
m_basesprite = swimBaseFrame;
makeHimSwim(true);
}
else if(left == 12)
{
m_basesprite = walkBaseFrame;
makeHimSwim(false);
}
// from bottom
if(down == 13)
{
bup = true;
m_basesprite = swimBaseFrame;
makeHimSwim(true);
}
else if(up == 13)
{
m_basesprite = walkBaseFrame;
makeHimSwim(false);
}
// from left
if(left == 14)
{
bright = true;
m_basesprite = swimBaseFrame;
makeHimSwim(true);
}
else if(right == 14)
{
m_basesprite = walkBaseFrame;
makeHimSwim(false);
}
if(m_Inventory.Item.m_special.ep4.swimsuit)
......@@ -1225,5 +1225,20 @@ void CPlayerWM::processMoveBitDown()
}
bool CPlayerWM::isSwimming()
{
return (m_basesprite == swimBaseFrame);
}
void CPlayerWM::makeHimSwim(const bool value)
{
if(value)
m_basesprite = swimBaseFrame;
else
m_basesprite = walkBaseFrame;
}
}
......@@ -33,12 +33,23 @@ public:
void serialize(CSaveGameController &savedGame)
{
savedGame.encodeData(mUsedGrapplingHook);
savedGame.encodeData(mUsedGrapplingHook);
}
void serialize(boost::property_tree::ptree &node)
{
node.put("usedGrapplingHook",mUsedGrapplingHook);
const bool swimming = isSwimming();
node.put("isSwimming",swimming);
}
void deserialize(boost::property_tree::ptree &node)
{
mUsedGrapplingHook = node.get<bool>("usedGrapplingHook", false);
bool swimming;
swimming = node.get<bool>("isSwimming",false);
makeHimSwim(swimming);
}
void process();
......@@ -76,6 +87,9 @@ public:
void processMoveBitDown();
bool isSwimming();
void makeHimSwim(const bool value);
private:
Uint16 m_basesprite;
Uint16 m_teleportanibasetile;
......
......@@ -122,7 +122,7 @@ void stItemGalaxy::operator<<(boost::property_tree::ptree &invNode)
if(ep == 4)
{
m_special.ep4.elders = invNode.get<int>("elders", 0);
m_special.ep4.swimsuit = invNode.get<int>("swimsuit", 0);
m_special.ep4.swimsuit = invNode.get<bool>("swimsuit", false);
}
else if(ep == 6)
{
......
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