Explorar el Código

- fixed compile issues. Renamed several "battleobstacleSplaced" to "battleobstacleplaced"
- implemented --disable-video command line switch

Ivan Savenko hace 13 años
padre
commit
82b60c00a2
Se han modificado 4 ficheros con 11 adiciones y 8 borrados
  1. 6 1
      client/CMT.cpp
  2. 1 2
      client/CPlayerInterface.cpp
  3. 1 1
      client/NetPacksClient.cpp
  4. 3 4
      server/CGameHandler.cpp

+ 6 - 1
client/CMT.cpp

@@ -197,6 +197,7 @@ int main(int argc, char** argv)
 		("onlyAI", "runs without GUI, all players will be default AI")
 		("oneGoodAI", "puts one default AI and the rest will be EmptyAI")
 		("autoSkip", "automatically skip turns in GUI")
+		("disable-video", "disable video player")
 		("nointro,i", "skips intro movies");
 
 	po::variables_map vm;
@@ -265,7 +266,11 @@ int main(int argc, char** argv)
 #if defined _M_X64 && defined _WIN32 //Win64 -> cannot load 32-bit DLLs for video handling
 	CCS->videoh = new CEmptyVideoPlayer;
 #else
-	CCS->videoh = new CVideoPlayer;
+	if (!vm.count("disable-video"))
+		CCS->videoh = new CVideoPlayer;
+	else
+		CCS->videoh = new CEmptyVideoPlayer;
+
 #endif
 	tlog0<<"\tInitializing video: "<<pomtime.getDiff()<<std::endl;
 

+ 1 - 2
client/CPlayerInterface.cpp

@@ -909,8 +909,7 @@ void CPlayerInterface::battleAttack(const BattleAttack *ba)
 		battleInt->stackAttacking( attacker, ba->counter() ? curAction->destinationTile + shift : curAction->additionalInfo, attacked, false);
 	}
 }
-
-void CPlayerInterface::battleObstaclesPlaced(const CObstacleInstance &obstacle)
+void CPlayerInterface::battleObstaclePlaced(const CObstacleInstance &obstacle)
 {
 	EVENT_HANDLER_CALLED_BY_CLIENT;
 	if(LOCPLINT != this)

+ 1 - 1
client/NetPacksClient.cpp

@@ -597,7 +597,7 @@ void BattleTriggerEffect::applyCl(CClient * cl)
 
 void BattleObstaclePlaced::applyCl(CClient * cl)
 {
-	BATTLE_INTERFACE_CALL_IF_PRESENT_FOR_BOTH_SIDES(battleObstaclesPlaced, obstacle);
+	BATTLE_INTERFACE_CALL_IF_PRESENT_FOR_BOTH_SIDES(battleObstaclePlaced, obstacle);
 }
 
 void BattleResult::applyFirstCl( CClient *cl )

+ 3 - 4
server/CGameHandler.cpp

@@ -906,9 +906,9 @@ startWalking:
 			si.stacks.push_back(bsa);
 			sendAndApply(&si);
 
-			ObstaclesRemoved or;
-			or.obstacles.insert(obstacle->uniqueID);
-			sendAndApply(&or);
+			ObstaclesRemoved obsRem;
+			obsRem.obstacles.insert(obstacle->uniqueID);
+			sendAndApply(&obsRem);
 
 			//if stack didn't die in explosion, continue movement
 			if(curStack->alive())
@@ -918,7 +918,6 @@ startWalking:
 			}
 		}
 	}
-
 	return ret;
 }