diff --git a/source/glest_game/ai/ai_rule.cpp b/source/glest_game/ai/ai_rule.cpp index 867c926a..f8815c41 100644 --- a/source/glest_game/ai/ai_rule.cpp +++ b/source/glest_game/ai/ai_rule.cpp @@ -1160,7 +1160,7 @@ void AiRuleProduce::produceSpecific(const ProduceTask *pt){ if(SystemFlags::getSystemSettingType(SystemFlags::debugSystem).enabled) SystemFlags::OutputDebug(SystemFlags::debugSystem,"In [%s::%s Line: %d] producers.size() = %d, producerIndex = %d, pIndex = %d, producersDefaultCommandType.size() = %d\n",__FILE__,__FUNCTION__,__LINE__,producers.size(),producerIndex,pIndex,producersDefaultCommandType.size()); - if(ai->outputAIBehaviourToConsole()) printf("produceSpecific giveCommand to unit [%s] commandType [%s]\n",aiInterface->getMyUnit(producerIndex)->getType()->getName().c_str(),defCt->getName().c_str()); + if(ai->outputAIBehaviourToConsole()) printf("produceSpecific giveCommand to unit [%s] commandType [%s]\n",aiInterface->getMyUnit(producerIndex)->getType()->getName().c_str(),(defCt != NULL ? defCt->getName().c_str() : "n/a")); if(aiInterface->isLogLevelEnabled(4) == true) { char szBuf[8096]=""; snprintf(szBuf,8096,"produceSpecific giveCommand to unit [%s] commandType [%s]",aiInterface->getMyUnit(producerIndex)->getType()->getName().c_str(),(defCt != NULL ? defCt->getName().c_str() : "(null)")); diff --git a/source/glest_game/network/network_message.cpp b/source/glest_game/network/network_message.cpp index 4bc1de9f..efa6baf7 100644 --- a/source/glest_game/network/network_message.cpp +++ b/source/glest_game/network/network_message.cpp @@ -1085,7 +1085,6 @@ bool NetworkMessageLaunch::receive(Socket* socket) { } for(unsigned int i = 0; i < maxFactionCRCCount; ++i) { data.factionNameList[i].nullTerminate(); - data.networkPlayerUUID[i].nullTerminate(); } data.scenario.nullTerminate(); diff --git a/source/glest_game/network/server_interface.cpp b/source/glest_game/network/server_interface.cpp index f8d71364..7ff9e80b 100644 --- a/source/glest_game/network/server_interface.cpp +++ b/source/glest_game/network/server_interface.cpp @@ -2336,6 +2336,9 @@ void ServerInterface::broadcastGameSetup(GameSettings *gameSettingsBuffer, bool } } if(setGameSettingsBuffer == true) { + if(gameSettingsBuffer == NULL) { + throw megaglest_runtime_error("gameSettingsBuffer == NULL"); + } validateGameSettings(gameSettingsBuffer); //setGameSettings(gameSettingsBuffer,false); MutexSafeWrapper safeMutex(serverSynchAccessor,CODE_AT_LINE); diff --git a/source/glest_game/world/unit_updater.cpp b/source/glest_game/world/unit_updater.cpp index e47a4aa5..e839f794 100644 --- a/source/glest_game/world/unit_updater.cpp +++ b/source/glest_game/world/unit_updater.cpp @@ -1771,7 +1771,7 @@ void UnitUpdater::updateRepair(Unit *unit, int frameIndex) { if(SystemFlags::getSystemSettingType(SystemFlags::debugUnitCommands).enabled) SystemFlags::OutputDebug(SystemFlags::debugUnitCommands,"In [%s::%s Line: %d] rct = %p\n",__FILE__,__FUNCTION__,__LINE__,rct); - Unit *repaired = map->getCell(command->getPos())->getUnitWithEmptyCellMap(fLand); + Unit *repaired = (command != NULL ? map->getCell(command->getPos())->getUnitWithEmptyCellMap(fLand) : NULL); if(repaired == NULL) { repaired = map->getCell(command->getPos())->getUnit(fLand); }