Changeset 5329 in orxonox.OLD for trunk/src/lib/shell/shell_command.cc
- Timestamp:
- Oct 8, 2005, 11:07:21 PM (20 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/lib/shell/shell_command.cc
r5328 r5329 422 422 if (ShellCommandClass::commandClassList == NULL) 423 423 return false; 424 425 424 426 425 long classID = CL_NULL; //< the classID retrieved from the Class. … … 482 481 } 483 482 484 if (classID != CL_NULL && inputSplits.getCount() >= 2 && objectList != NULL) 485 { 486 // Checking for a Match in the Objects of classID (else take the first) 487 tIterator<BaseObject>* itBO = objectList->getIterator(); 488 BaseObject* enumBO = itBO->firstElement(); 489 while(enumBO) 483 if (commandClass != NULL && inputSplits.getCount() >= 2) 484 { 485 if (objectList != NULL) 490 486 { 491 if (enumBO->getName() != NULL && !strcasecmp(enumBO->getName(), inputSplits.getString(1))) 487 // Checking for a Match in the Objects of classID (else take the first) 488 tIterator<BaseObject>* itBO = objectList->getIterator(); 489 BaseObject* enumBO = itBO->firstElement(); 490 while(enumBO) 492 491 { 493 objectPointer = enumBO; 494 fktPos++; 495 break; 496 } 497 enumBO = itBO->nextElement(); 492 if (enumBO->getName() != NULL && !strcasecmp(enumBO->getName(), inputSplits.getString(1))) 493 { 494 objectPointer = enumBO; 495 fktPos = 2; 496 break; 497 } 498 enumBO = itBO->nextElement(); 499 } 500 delete itBO; 501 502 // 503 if (objectPointer == NULL) 504 objectPointer = objectList->firstElement(); 498 505 } 499 delete itBO; 500 501 // 502 if (objectPointer == NULL) 503 objectPointer = objectList->firstElement(); 504 506 printf("test\n"); 505 507 // match a function. 506 if (commandClass != NULL && objectPointer != NULL &&(fktPos == 1 || (fktPos == 2 && inputSplits.getCount() >= 3)))508 if (commandClass != NULL && (fktPos == 1 || (fktPos == 2 && inputSplits.getCount() >= 3))) 507 509 { 508 510 tIterator<ShellCommandBase>* itCMD = commandClass->commandList->getIterator(); … … 512 514 if (!strcmp(enumCMD->getName(), inputSplits.getString(fktPos))) 513 515 { 516 if (objectPointer == NULL && enumCMD->functorType == ShellCommand_Objective) 517 { 518 delete itCMD; 519 return false; 520 } 514 521 if (inputSplits.getCount() > fktPos+1) 515 522 enumCMD->executeCommand(objectPointer, executionString+inputSplits.getOffset(fktPos +1)); … … 622 629 623 630 return this; 624 }625 626 627 /**628 * see ShellCommandBase::debug()629 */630 void ShellCommandBase::debugDyn()631 {632 this->debug();633 631 } 634 632
Note: See TracChangeset
for help on using the changeset viewer.