- Timestamp:
- Aug 27, 2005, 12:56:47 AM (19 years ago)
- Location:
- trunk/src
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/util/shell_command.cc
r5143 r5144 146 146 commandBegin++; 147 147 if (strncmp (commandBegin, elem->getName(), strlen(elem->getName()))) 148 { 149 elem = iterator->nextElement(); 148 150 continue; 151 } 152 // getting singleton-reference 149 153 objectPointer = ClassList::getList(elem->classID)->firstElement(); 150 154 } 151 155 else 152 156 { 157 // checking for the Object 153 158 while(*commandBegin == ' ') 154 159 commandBegin++; 155 160 tIterator<BaseObject>* iterBO = ClassList::getList(elem->classID)->getIterator(); 156 161 BaseObject* enumBO = iterBO->firstElement(); 162 while(enumBO != NULL) 157 163 { 158 if( 164 if(!strncmp(commandBegin, enumBO->getName(), strlen(enumBO->getName()))) 159 165 { 166 PRINTF(4)("Object %s matches\n", enumBO->getName()); 160 167 objectPointer = enumBO; 161 168 break; … … 165 172 delete iterBO; 166 173 174 // break on no object Found. We cannot operate on Classes, but on Objects 167 175 if (objectPointer == NULL) 168 176 break; … … 170 178 while(*commandBegin == ' ') 171 179 commandBegin++; 180 // checking for the requested function. 181 if (strncmp (commandBegin, elem->getName(), strlen(elem->getName()))) 182 { 183 elem = iterator->nextElement(); 184 continue; 185 } 186 PRINTF(3)("Function '%s' found\n", commandBegin); 172 187 } 173 const char* commandEnd= strchr(commandBegin, ' ');174 if ( commandEnd== NULL)175 commandEnd = commandBegin + strlen(commandBegin);188 const char* paramBegin = strchr(commandBegin, ' '); 189 if (paramBegin == NULL) 190 paramBegin = commandBegin + strlen(elem->getName()); 176 191 177 192 if (objectPointer != NULL) 178 193 { 179 elem->executeCommand(objectPointer, commandEnd);194 elem->executeCommand(objectPointer, paramBegin); 180 195 delete iterator; 181 196 return true; -
trunk/src/world_entities/player.cc
r5143 r5144 140 140 // this->setRelDir(Quaternion(M_PI, Vector(1,0,0))); 141 141 this->setClassID(CL_PLAYER, "Player"); 142 143 PRINTF(1)("PLAYER INIT\n"); 142 144 travelSpeed = 15.0; 143 145 velocity = new Vector();
Note: See TracChangeset
for help on using the changeset viewer.