mirror of
https://github.com/vcmi/vcmi.git
synced 2025-01-26 03:52:01 +02:00
CPlayerInterface: don't stop hero movement on embark / disembark
When hero have free boarding bonus there no reason to stop movement.
This commit is contained in:
parent
1162923d93
commit
ae13123129
@ -308,7 +308,7 @@ void CPlayerInterface::heroMoved(const TryMoveHero & details)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (details.result != TryMoveHero::SUCCESS) //hero failed to move
|
if(details.stopMovement()) //hero failed to move
|
||||||
{
|
{
|
||||||
hero->isStanding = true;
|
hero->isStanding = true;
|
||||||
stillMoveHero.setn(STOP_MOVE);
|
stillMoveHero.setn(STOP_MOVE);
|
||||||
|
@ -420,6 +420,11 @@ void TryMoveHero::applyCl(CClient *cl)
|
|||||||
CGI->mh->printObject(h);
|
CGI->mh->printObject(h);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool TryMoveHero::stopMovement() const
|
||||||
|
{
|
||||||
|
return result != SUCCESS && result != EMBARK && result != DISEMBARK && result != TELEPORTATION;
|
||||||
|
}
|
||||||
|
|
||||||
void NewStructures::applyCl(CClient *cl)
|
void NewStructures::applyCl(CClient *cl)
|
||||||
{
|
{
|
||||||
CGTownInstance *town = GS(cl)->getTown(tid);
|
CGTownInstance *town = GS(cl)->getTown(tid);
|
||||||
|
@ -634,6 +634,8 @@ struct TryMoveHero : public CPackForClient
|
|||||||
|
|
||||||
bool humanKnows; //used locally during applying to client
|
bool humanKnows; //used locally during applying to client
|
||||||
|
|
||||||
|
bool stopMovement() const;
|
||||||
|
|
||||||
template <typename Handler> void serialize(Handler &h, const int version)
|
template <typename Handler> void serialize(Handler &h, const int version)
|
||||||
{
|
{
|
||||||
h & id;
|
h & id;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user