mirror of
https://github.com/vcmi/vcmi.git
synced 2025-08-15 20:03:15 +02:00
Merge pull request #3257 from IvanSavenko/bugfixing2
Bugfixing for beta
This commit is contained in:
@@ -441,12 +441,10 @@ void AdventureMapInterface::onPlayerTurnStarted(PlayerColor playerID)
|
|||||||
if(auto iw = GH.windows().topWindow<CInfoWindow>())
|
if(auto iw = GH.windows().topWindow<CInfoWindow>())
|
||||||
iw->close();
|
iw->close();
|
||||||
|
|
||||||
boost::thread newThread([this]()
|
GH.dispatchMainThread([this]()
|
||||||
{
|
{
|
||||||
hotkeyEndingTurn();
|
hotkeyEndingTurn();
|
||||||
});
|
});
|
||||||
|
|
||||||
newThread.detach();
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -83,7 +83,10 @@ ArtifactID MapReaderH3M::readArtifact()
|
|||||||
|
|
||||||
ArtifactID MapReaderH3M::readArtifact8()
|
ArtifactID MapReaderH3M::readArtifact8()
|
||||||
{
|
{
|
||||||
ArtifactID result(reader->readInt8());
|
ArtifactID result(reader->readUInt8());
|
||||||
|
|
||||||
|
if(result.getNum() == 0xff)
|
||||||
|
return ArtifactID::NONE;
|
||||||
|
|
||||||
if (result.getNum() < features.artifactsCount)
|
if (result.getNum() < features.artifactsCount)
|
||||||
return remapIdentifier(result);
|
return remapIdentifier(result);
|
||||||
|
@@ -40,19 +40,11 @@ bool CPathfinderHelper::canMoveFromNode(const PathNodeInfo & source) const
|
|||||||
if (source.node->isTeleportAction())
|
if (source.node->isTeleportAction())
|
||||||
return true;
|
return true;
|
||||||
|
|
||||||
// we can go through garrisons
|
// we can not go through teleporters since moving onto a teleport will teleport hero and may invalidate path (e.g. one-way teleport or enemy hero on other side)
|
||||||
if (source.nodeObject->ID == MapObjectID::GARRISON || source.nodeObject->ID == MapObjectID::GARRISON2)
|
if (dynamic_cast<const CGTeleport*>(source.nodeObject) != nullptr)
|
||||||
return true;
|
return false;
|
||||||
|
|
||||||
// or through border gate (if we stand on it then we already have the key)
|
return true;
|
||||||
if (source.nodeObject->ID == MapObjectID::BORDER_GATE)
|
|
||||||
return true;
|
|
||||||
|
|
||||||
// or "through" boat, but only if this is embarking
|
|
||||||
if (source.nodeObject->ID == MapObjectID::BOAT && source.node->action == EPathNodeAction::EMBARK)
|
|
||||||
return true;
|
|
||||||
|
|
||||||
return false;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
std::vector<int3> CPathfinderHelper::getNeighbourTiles(const PathNodeInfo & source) const
|
std::vector<int3> CPathfinderHelper::getNeighbourTiles(const PathNodeInfo & source) const
|
||||||
|
@@ -221,6 +221,8 @@ int CConnection::read(void * data, unsigned size)
|
|||||||
|
|
||||||
CConnection::~CConnection()
|
CConnection::~CConnection()
|
||||||
{
|
{
|
||||||
|
close();
|
||||||
|
|
||||||
if(handler)
|
if(handler)
|
||||||
{
|
{
|
||||||
// ugly workaround to avoid self-join if last strong reference to shared_ptr that owns this class has been released in this very thread, e.g. on netpack processing
|
// ugly workaround to avoid self-join if last strong reference to shared_ptr that owns this class has been released in this very thread, e.g. on netpack processing
|
||||||
@@ -229,8 +231,6 @@ CConnection::~CConnection()
|
|||||||
else
|
else
|
||||||
handler->detach();
|
handler->detach();
|
||||||
}
|
}
|
||||||
|
|
||||||
close();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
template<class T>
|
template<class T>
|
||||||
@@ -246,6 +246,15 @@ void CConnection::close()
|
|||||||
{
|
{
|
||||||
if(socket)
|
if(socket)
|
||||||
{
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
socket->shutdown(boost::asio::ip::tcp::socket::shutdown_receive);
|
||||||
|
}
|
||||||
|
catch (const boost::system::system_error & e)
|
||||||
|
{
|
||||||
|
logNetwork->error("error closing socket: %s", e.what());
|
||||||
|
}
|
||||||
|
|
||||||
socket->close();
|
socket->close();
|
||||||
socket.reset();
|
socket.reset();
|
||||||
}
|
}
|
||||||
|
@@ -263,8 +263,6 @@ void TurnOrderProcessor::onPlayerEndsGame(PlayerColor which)
|
|||||||
|
|
||||||
if (actingPlayers.empty())
|
if (actingPlayers.empty())
|
||||||
doStartNewDay();
|
doStartNewDay();
|
||||||
|
|
||||||
assert(!actingPlayers.empty());
|
|
||||||
}
|
}
|
||||||
|
|
||||||
bool TurnOrderProcessor::onPlayerEndsTurn(PlayerColor which)
|
bool TurnOrderProcessor::onPlayerEndsTurn(PlayerColor which)
|
||||||
|
Reference in New Issue
Block a user