浏览代码

No error on hero move when timer is expired

nordsoft 2 年之前
父节点
当前提交
23aaa72dfe
共有 2 个文件被更改,包括 3 次插入1 次删除
  1. 3 0
      server/CGameHandler.cpp
  2. 0 1
      server/NetPacksServer.cpp

+ 3 - 0
server/CGameHandler.cpp

@@ -2220,6 +2220,9 @@ bool CGameHandler::moveHero(ObjectInstanceID hid, int3 dst, ui8 teleporting, boo
 	// not turn of that hero or player can't simply teleport hero (at least not with this function)
 	if (!h  || (asker != PlayerColor::NEUTRAL && (teleporting || h->getOwner() != gs->currentPlayer)))
 	{
+		if(h && getStartInfo()->turnTimerInfo.isEnabled() && gs->players[h->getOwner()].turnTimer.turnTimer == 0)
+			return true; //timer expired, no error
+		
 		logGlobal->error("Illegal call to move hero!");
 		return false;
 	}

+ 0 - 1
server/NetPacksServer.cpp

@@ -64,7 +64,6 @@ void ApplyGhNetPackVisitor::visitDismissHero(DismissHero & pack)
 
 void ApplyGhNetPackVisitor::visitMoveHero(MoveHero & pack)
 {
-	gh.throwOnWrongOwner(&pack, pack.hid);
 	result = gh.moveHero(pack.hid, pack.dest, 0, pack.transit, gh.getPlayerAt(pack.c));
 }