diff --git a/source/glest_game/game/commander.cpp b/source/glest_game/game/commander.cpp index 00369c66..f2e33091 100644 --- a/source/glest_game/game/commander.cpp +++ b/source/glest_game/game/commander.cpp @@ -489,20 +489,24 @@ CommandResult Commander::computeResult(const CommandResultContainer &results) co CommandResult Commander::pushNetworkCommand(const NetworkCommand* networkCommand) const { GameNetworkInterface *gameNetworkInterface= NetworkManager::getInstance().getGameNetworkInterface(); - const Unit* unit= world->findUnitById(networkCommand->getUnitId()); CommandResult cr= crSuccess; //validate unit - if(unit == NULL) { - char szBuf[1024]=""; - sprintf(szBuf,"In [%s::%s - %d] Command refers to non existent unit id = %d. Game out of synch.",__FILE__,__FUNCTION__,__LINE__,networkCommand->getUnitId()); - GameNetworkInterface *gameNetworkInterface= NetworkManager::getInstance().getGameNetworkInterface(); - if(gameNetworkInterface != NULL) { - char szMsg[1024]=""; - sprintf(szMsg,"Player detected an error: Command refers to non existent unit id = %d. Game out of synch.",networkCommand->getUnitId()); - gameNetworkInterface->sendTextMessage(szMsg,-1, true, ""); - } - throw runtime_error(szBuf); + const Unit* unit = NULL; + if( networkCommand->getNetworkCommandType() != nctSwitchTeam && + networkCommand->getNetworkCommandType() != nctSwitchTeamVote) { + unit= world->findUnitById(networkCommand->getUnitId()); + if(unit == NULL) { + char szBuf[1024]=""; + sprintf(szBuf,"In [%s::%s - %d] Command refers to non existent unit id = %d. Game out of synch.",__FILE__,__FUNCTION__,__LINE__,networkCommand->getUnitId()); + GameNetworkInterface *gameNetworkInterface= NetworkManager::getInstance().getGameNetworkInterface(); + if(gameNetworkInterface != NULL) { + char szMsg[1024]=""; + sprintf(szMsg,"Player detected an error: Command refers to non existent unit id = %d. Game out of synch.",networkCommand->getUnitId()); + gameNetworkInterface->sendTextMessage(szMsg,-1, true, ""); + } + throw runtime_error(szBuf); + } } //add the command to the interface diff --git a/source/shared_lib/sources/graphics/particle.cpp b/source/shared_lib/sources/graphics/particle.cpp index 50ea41de..fc27112a 100644 --- a/source/shared_lib/sources/graphics/particle.cpp +++ b/source/shared_lib/sources/graphics/particle.cpp @@ -508,7 +508,7 @@ void GameParticleSystem::setTween(float relative,float absolute) { truncateDecimal(tween); if(tween < 0.0f || tween > 1.0f) { - printf("In [%s::%s Line: %d] WARNING setting tween to [%f] clamping tween, modelCycle [%f] absolute [%f] relative [%f]\n",__FILE__,__FUNCTION__,__LINE__,tween,modelCycle,absolute,relative); + //printf("In [%s::%s Line: %d] WARNING setting tween to [%f] clamping tween, modelCycle [%f] absolute [%f] relative [%f]\n",__FILE__,__FUNCTION__,__LINE__,tween,modelCycle,absolute,relative); //assert(tween >= 0.0f && tween <= 1.0f); }