mirror of
https://github.com/vcmi/vcmi.git
synced 2025-02-03 13:01:33 +02:00
parent
abf54deaa3
commit
9af18cf487
@ -43,6 +43,7 @@
|
||||
#include <cstdlib>
|
||||
#include "../lib/NetPacks.h"
|
||||
#include "CMessage.h"
|
||||
#include "../hch/CObjectHandler.h"
|
||||
|
||||
#ifdef _WIN32
|
||||
#include "SDL_syswm.h"
|
||||
@ -421,6 +422,11 @@ void processCommand(const std::string &message)
|
||||
{
|
||||
gOnlyAI = true;
|
||||
}
|
||||
else if(cn == "mp" && adventureInt)
|
||||
{
|
||||
if(const CGHeroInstance *h = dynamic_cast<const CGHeroInstance *>(adventureInt->selection))
|
||||
tlog0 << h->movement << "; max: " << h->maxMovePoints(true) << "/" << h->maxMovePoints(false) << std::endl;
|
||||
}
|
||||
else if(client && client->serv && client->serv->connected) //send to server
|
||||
{
|
||||
PlayerMessage pm(LOCPLINT->playerID,message);
|
||||
|
@ -1776,7 +1776,7 @@ int CGameState::getMovementCost(const CGHeroInstance *h, const int3 &src, const
|
||||
//get basic cost
|
||||
int ret = h->getTileCost(d,s);
|
||||
|
||||
if(d.blocked)
|
||||
if(d.blocked && h->hasBonusOfType(Bonus::FLYING_MOVEMENT))
|
||||
{
|
||||
bool freeFlying = h->getBonusesCount(Selector::typeSybtype(Bonus::FLYING_MOVEMENT, 1)) > 0;
|
||||
|
||||
|
@ -420,8 +420,9 @@ public:
|
||||
|
||||
bool operator()(const Bonus &bonus) const
|
||||
{
|
||||
return !turnsRequested
|
||||
|| ( bonus.turnsRemain > turnsRequested && bonus.duration == Bonus::N_TURNS);
|
||||
return turnsRequested <= 0 //every present effect will last zero (or "less") turns
|
||||
|| !(bonus.duration & Bonus::N_TURNS) //so do every not expriing after N-turns effect
|
||||
|| bonus.turnsRemain > turnsRequested;
|
||||
}
|
||||
CWillLastTurns& operator()(const int &setVal)
|
||||
{
|
||||
|
Loading…
x
Reference in New Issue
Block a user