Commit ee8ed389 authored by Gerhard Stein's avatar Gerhard Stein

Flag Bug fixes with saved games

parent 5aa65fb4
......@@ -12,7 +12,6 @@
namespace galaxy {
const Uint16 FLYING_BASEFRAME = 174;
const Uint16 WAVING_BASEFRAME = 181;
const Uint16 ANIMATION_TIME = 8;
const Uint16 SPEED = 64;
......@@ -27,15 +26,8 @@ processState(&CFlag::processFlying)
{
solid = false;
honorPriority = false;
// Here we move the coordinates in order get it positioned correctly in the pole
m_destination.x += (6<<STC);
CSprite &Sprite = g_pGfxEngine->getSprite(WAVING_BASEFRAME);
sprite = WAVING_BASEFRAME;
calcBoundingBoxes();
m_destination.y -= Sprite.m_bboxY2;
m_destination.y += (1<<STC);
}
/**
......
......@@ -14,6 +14,8 @@
#include "engine/galaxy/CGalaxySpriteObject.h"
#include "CVec.h"
const Uint16 WAVING_BASEFRAME = 181;
namespace galaxy {
class CFlag : public CGalaxySpriteObject
......
......@@ -377,10 +377,13 @@ void CPlayerBase::setActionForce(const size_t ActionNumber)
{
CGalaxySpriteObject::setActionForce(ActionNumber);
if(mActionMap.empty())
return;
if( mActionMap.find(ActionNumber) != mActionMap.end() )
mp_processState = mActionMap[ActionNumber];
else
setActionForce(0); // This might happen, when the action-map is incomplete
setActionForce(mActionMap.begin()->first); // This might happen, when the action-map is incomplete
}
......
......@@ -212,7 +212,18 @@ void CPlayerWM::finishLevel(Uint16 object)
{
// spawn the flag
VectorD2<Uint32> src(getXPosition(), getYPosition());
VectorD2<Uint32> dst((x<<CSF), (y<<CSF));
// Here we move the coordinates in order get it positioned correctly in the pole
CSprite &FlagSprite = g_pGfxEngine->getSprite(WAVING_BASEFRAME);
unsigned int csfX = (x<<CSF);
unsigned int csfY = (y<<CSF);
csfX += (6<<STC);
csfY -= FlagSprite.m_bboxY2;
csfY += (1<<STC);
VectorD2<Uint32> dst(csfX, csfY);
CFlag *pFlag = new CFlag(mp_Map, src, dst);
m_ObjectPtrs.push_back(pFlag);
......
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