mirror of
https://github.com/glest/glest-source.git
synced 2025-09-03 13:02:37 +02:00
- bugfix for server controlled AI mode
This commit is contained in:
@@ -174,16 +174,21 @@ CommandResult AiInterface::giveCommand(int unitIndex, const CommandType *command
|
|||||||
CommandResult AiInterface::giveCommand(int unitIndex, const CommandType *commandType, Unit *u){
|
CommandResult AiInterface::giveCommand(int unitIndex, const CommandType *commandType, Unit *u){
|
||||||
assert(this->gameSettings != NULL);
|
assert(this->gameSettings != NULL);
|
||||||
assert(this->commander != NULL);
|
assert(this->commander != NULL);
|
||||||
|
//assert(u != NULL);
|
||||||
|
//assert(u->getType() != NULL);
|
||||||
|
|
||||||
if(enableServerControlledAI == true &&
|
if(enableServerControlledAI == true &&
|
||||||
this->gameSettings->isNetworkGame() == true &&
|
this->gameSettings->isNetworkGame() == true &&
|
||||||
NetworkManager::getInstance().getNetworkRole() == nrServer) {
|
NetworkManager::getInstance().getNetworkRole() == nrServer) {
|
||||||
SystemFlags::OutputDebug(SystemFlags::debugSystem,"In [%s::%s Line: %d]\n",__FILE__,__FUNCTION__,__LINE__);
|
SystemFlags::OutputDebug(SystemFlags::debugSystem,"In [%s::%s Line: %d]\n",__FILE__,__FUNCTION__,__LINE__);
|
||||||
|
|
||||||
assert(u != NULL);
|
//assert(u != NULL);
|
||||||
|
|
||||||
SystemFlags::OutputDebug(SystemFlags::debugSystem,"In [%s::%s Line: %d]\n",__FILE__,__FUNCTION__,__LINE__);
|
SystemFlags::OutputDebug(SystemFlags::debugSystem,"In [%s::%s Line: %d]\n",__FILE__,__FUNCTION__,__LINE__);
|
||||||
|
|
||||||
|
if(u == NULL) {
|
||||||
|
u = world->getFaction(factionIndex)->getUnit(unitIndex);
|
||||||
|
}
|
||||||
CommandResult result = commander->tryGiveCommand(u, commandType, Vec2i(0), u->getType(),CardinalDir::NORTH);
|
CommandResult result = commander->tryGiveCommand(u, commandType, Vec2i(0), u->getType(),CardinalDir::NORTH);
|
||||||
|
|
||||||
SystemFlags::OutputDebug(SystemFlags::debugSystem,"In [%s::%s Line: %d]\n",__FILE__,__FUNCTION__,__LINE__);
|
SystemFlags::OutputDebug(SystemFlags::debugSystem,"In [%s::%s Line: %d]\n",__FILE__,__FUNCTION__,__LINE__);
|
||||||
|
Reference in New Issue
Block a user