mirror of
https://github.com/vcmi/vcmi.git
synced 2025-07-15 01:24:45 +02:00
@ -220,6 +220,7 @@ void CPlayerInterface::heroMoved(const HeroMoveDetails & details)
|
||||
if(details.dst.x+1 == details.src.x && details.dst.y+1 == details.src.y) //tl
|
||||
{
|
||||
ho->moveDir = 1;
|
||||
ho->isStanding = false;
|
||||
CGI->mh->ttiles[hp.x-3][hp.y-2][hp.z].objects.push_back(std::make_pair(ho, genRect(32, 32, -31, -31)));
|
||||
CGI->mh->ttiles[hp.x-2][hp.y-2][hp.z].objects.push_back(std::make_pair(ho, genRect(32, 32, 1, -31)));
|
||||
CGI->mh->ttiles[hp.x-1][hp.y-2][hp.z].objects.push_back(std::make_pair(ho, genRect(32, 32, 33, -31)));
|
||||
@ -253,6 +254,7 @@ void CPlayerInterface::heroMoved(const HeroMoveDetails & details)
|
||||
else if(details.dst.x == details.src.x && details.dst.y+1 == details.src.y) //t
|
||||
{
|
||||
ho->moveDir = 2;
|
||||
ho->isStanding = false;
|
||||
CGI->mh->ttiles[hp.x-2][hp.y-2][hp.z].objects.push_back(std::make_pair(ho, genRect(32, 32, 0, -31)));
|
||||
CGI->mh->ttiles[hp.x-1][hp.y-2][hp.z].objects.push_back(std::make_pair(ho, genRect(32, 32, 32, -31)));
|
||||
CGI->mh->ttiles[hp.x][hp.y-2][hp.z].objects.push_back(std::make_pair(ho, genRect(32, 32, 64, -31)));
|
||||
@ -280,6 +282,7 @@ void CPlayerInterface::heroMoved(const HeroMoveDetails & details)
|
||||
else if(details.dst.x-1 == details.src.x && details.dst.y+1 == details.src.y) //tr
|
||||
{
|
||||
ho->moveDir = 3;
|
||||
ho->isStanding = false;
|
||||
CGI->mh->ttiles[hp.x-2][hp.y-2][hp.z].objects.push_back(std::make_pair(ho, genRect(32, 32, -1, -31)));
|
||||
CGI->mh->ttiles[hp.x-1][hp.y-2][hp.z].objects.push_back(std::make_pair(ho, genRect(32, 32, 31, -31)));
|
||||
CGI->mh->ttiles[hp.x][hp.y-2][hp.z].objects.push_back(std::make_pair(ho, genRect(32, 32, 63, -31)));
|
||||
@ -313,6 +316,7 @@ void CPlayerInterface::heroMoved(const HeroMoveDetails & details)
|
||||
else if(details.dst.x-1 == details.src.x && details.dst.y == details.src.y) //r
|
||||
{
|
||||
ho->moveDir = 4;
|
||||
ho->isStanding = false;
|
||||
subRect(hp.x-2, hp.y-1, hp.z, genRect(32, 32, -1, 0), ho->id);
|
||||
subRect(hp.x-1, hp.y-1, hp.z, genRect(32, 32, 31, 0), ho->id);
|
||||
subRect(hp.x, hp.y-1, hp.z, genRect(32, 32, 63, 0), ho->id);
|
||||
@ -336,6 +340,7 @@ void CPlayerInterface::heroMoved(const HeroMoveDetails & details)
|
||||
else if(details.dst.x-1 == details.src.x && details.dst.y-1 == details.src.y) //br
|
||||
{
|
||||
ho->moveDir = 5;
|
||||
ho->isStanding = false;
|
||||
subRect(hp.x-2, hp.y-1, hp.z, genRect(32, 32, -1, -1), ho->id);
|
||||
subRect(hp.x-1, hp.y-1, hp.z, genRect(32, 32, 31, -1), ho->id);
|
||||
subRect(hp.x, hp.y-1, hp.z, genRect(32, 32, 63, -1), ho->id);
|
||||
@ -369,6 +374,7 @@ void CPlayerInterface::heroMoved(const HeroMoveDetails & details)
|
||||
else if(details.dst.x == details.src.x && details.dst.y-1 == details.src.y) //b
|
||||
{
|
||||
ho->moveDir = 6;
|
||||
ho->isStanding = false;
|
||||
subRect(hp.x-2, hp.y-1, hp.z, genRect(32, 32, 0, -1), ho->id);
|
||||
subRect(hp.x-1, hp.y-1, hp.z, genRect(32, 32, 32, -1), ho->id);
|
||||
subRect(hp.x, hp.y-1, hp.z, genRect(32, 32, 64, -1), ho->id);
|
||||
@ -396,6 +402,7 @@ void CPlayerInterface::heroMoved(const HeroMoveDetails & details)
|
||||
else if(details.dst.x+1 == details.src.x && details.dst.y-1 == details.src.y) //bl
|
||||
{
|
||||
ho->moveDir = 7;
|
||||
ho->isStanding = false;
|
||||
CGI->mh->ttiles[hp.x-3][hp.y-1][hp.z].objects.push_back(std::make_pair(ho, genRect(32, 32, -31, -1)));
|
||||
subRect(hp.x-2, hp.y-1, hp.z, genRect(32, 32, 1, -1), ho->id);
|
||||
subRect(hp.x-1, hp.y-1, hp.z, genRect(32, 32, 33, -1), ho->id);
|
||||
@ -429,6 +436,7 @@ void CPlayerInterface::heroMoved(const HeroMoveDetails & details)
|
||||
else if(details.dst.x+1 == details.src.x && details.dst.y == details.src.y) //l
|
||||
{
|
||||
ho->moveDir = 8;
|
||||
ho->isStanding = false;
|
||||
CGI->mh->ttiles[hp.x-3][hp.y-1][hp.z].objects.push_back(std::make_pair(ho, genRect(32, 32, -31, 0)));
|
||||
subRect(hp.x-2, hp.y-1, hp.z, genRect(32, 32, 1, 0), ho->id);
|
||||
subRect(hp.x-1, hp.y-1, hp.z, genRect(32, 32, 33, 0), ho->id);
|
||||
@ -744,7 +752,8 @@ void CPlayerInterface::heroMoved(const HeroMoveDetails & details)
|
||||
delObjRect(hp.x, hp.y, hp.z, ho->id);
|
||||
}
|
||||
ho->pos = details.dst; //copy of hero's position
|
||||
ho->moveDir = 0; //move ended
|
||||
//ho->moveDir = 0; //move ended
|
||||
ho->isStanding = true;
|
||||
//move finished
|
||||
}
|
||||
void CPlayerInterface::heroKilled(const CHeroInstance * hero)
|
||||
|
Reference in New Issue
Block a user