1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-11-23 22:37:55 +02:00

Make console available during other players' turn

This commit is contained in:
nordsoft
2022-10-05 19:04:51 +04:00
parent 3ff38b84a2
commit 895ec2d302
8 changed files with 34 additions and 13 deletions

View File

@@ -61,7 +61,7 @@ void CPackForServer::throwOnWrongOwner(CGameHandler * gh, ObjectInstanceID id)
void CPackForServer::throwOnWrongPlayer(CGameHandler * gh, PlayerColor player)
{
if(player != gh->getPlayerAt(c))
if(!gh->hasPlayerAt(player, c) && player != gh->getPlayerAt(c))
{
wrongPlayerMessage(gh, player);
throwNotAllowedAction();
@@ -381,11 +381,8 @@ bool CastAdvSpell::applyGh(CGameHandler * gh)
bool PlayerMessage::applyGh(CGameHandler * gh)
{
if(!player.isSpectator()) // TODO: clearly not a great way to verify permissions
{
throwOnWrongPlayer(gh, player);
if(gh->getPlayerAt(this->c) != player)
throwNotAllowedAction();
}
gh->playerMessage(player, text, currObj);
return true;
}