- bugfix for team switching validation should be skipped
- commented printf for tween debugging
This commit is contained in:
parent
d52924f214
commit
7e16873efd
|
@ -489,20 +489,24 @@ CommandResult Commander::computeResult(const CommandResultContainer &results) co
|
||||||
|
|
||||||
CommandResult Commander::pushNetworkCommand(const NetworkCommand* networkCommand) const {
|
CommandResult Commander::pushNetworkCommand(const NetworkCommand* networkCommand) const {
|
||||||
GameNetworkInterface *gameNetworkInterface= NetworkManager::getInstance().getGameNetworkInterface();
|
GameNetworkInterface *gameNetworkInterface= NetworkManager::getInstance().getGameNetworkInterface();
|
||||||
const Unit* unit= world->findUnitById(networkCommand->getUnitId());
|
|
||||||
CommandResult cr= crSuccess;
|
CommandResult cr= crSuccess;
|
||||||
|
|
||||||
//validate unit
|
//validate unit
|
||||||
if(unit == NULL) {
|
const Unit* unit = NULL;
|
||||||
char szBuf[1024]="";
|
if( networkCommand->getNetworkCommandType() != nctSwitchTeam &&
|
||||||
sprintf(szBuf,"In [%s::%s - %d] Command refers to non existent unit id = %d. Game out of synch.",__FILE__,__FUNCTION__,__LINE__,networkCommand->getUnitId());
|
networkCommand->getNetworkCommandType() != nctSwitchTeamVote) {
|
||||||
GameNetworkInterface *gameNetworkInterface= NetworkManager::getInstance().getGameNetworkInterface();
|
unit= world->findUnitById(networkCommand->getUnitId());
|
||||||
if(gameNetworkInterface != NULL) {
|
if(unit == NULL) {
|
||||||
char szMsg[1024]="";
|
char szBuf[1024]="";
|
||||||
sprintf(szMsg,"Player detected an error: Command refers to non existent unit id = %d. Game out of synch.",networkCommand->getUnitId());
|
sprintf(szBuf,"In [%s::%s - %d] Command refers to non existent unit id = %d. Game out of synch.",__FILE__,__FUNCTION__,__LINE__,networkCommand->getUnitId());
|
||||||
gameNetworkInterface->sendTextMessage(szMsg,-1, true, "");
|
GameNetworkInterface *gameNetworkInterface= NetworkManager::getInstance().getGameNetworkInterface();
|
||||||
}
|
if(gameNetworkInterface != NULL) {
|
||||||
throw runtime_error(szBuf);
|
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
|
//add the command to the interface
|
||||||
|
|
|
@ -508,7 +508,7 @@ void GameParticleSystem::setTween(float relative,float absolute) {
|
||||||
|
|
||||||
truncateDecimal<float>(tween);
|
truncateDecimal<float>(tween);
|
||||||
if(tween < 0.0f || tween > 1.0f) {
|
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);
|
//assert(tween >= 0.0f && tween <= 1.0f);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue