Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
May 25, 2008, 1:11:51 AM (16 years ago)
Author:
landauf
Message:
  • fixed a bug in CommandExecutor
  • InGameConsole wraps now too long output lines and does something similar for the input line
File:
1 edited

Legend:

Unmodified
Added
Removed
  • code/branches/console/src/core/CommandEvaluation.cc

    r1402 r1416  
    5353        this->listOfPossibleIdentifiers_.clear();
    5454        this->listOfPossibleFunctions_.clear();
     55        this->listOfPossibleArguments_.clear();
    5556
    5657        this->functionclass_ = 0;
     
    114115std::cout << "complete: function != 0" << std::endl;
    115116                    if (this->commandTokens_.size() > 1)
    116                         return (this->function_->getName() + " " + this->commandTokens_.subSet(1, this->commandTokens_.size() - 1).join() + " " + CommandEvaluation::getCommonBegin(this->listOfPossibleArguments_));
     117                    {
     118                        if ((this->commandTokens_.size() - 1) >= this->function_->getParamCount())
     119                            return (this->function_->getName() + " " + this->commandTokens_.subSet(1, this->commandTokens_.size()).join());
     120                        else
     121                            return (this->function_->getName() + " " + this->commandTokens_.subSet(1, this->commandTokens_.size()).join() + " " + CommandEvaluation::getCommonBegin(this->listOfPossibleArguments_));
     122                    }
    117123                    else
    118124                        return (this->function_->getName() + " ");
     
    125131std::cout << "complete: function != 0" << std::endl;
    126132                    if (this->commandTokens_.size() > 1)
    127                         return (this->function_->getName() + " " + this->commandTokens_.subSet(1, this->commandTokens_.size() - 1).join());
     133                        return (this->function_->getName() + " " + this->commandTokens_.subSet(1, this->commandTokens_.size()).join());
    128134                    else
    129135                        return (this->function_->getName());
     
    144150std::cout << "complete: function und functionclass != 0" << std::endl;
    145151                    if (this->commandTokens_.size() > 2)
    146                         return (this->functionclass_->getName() + " " + this->function_->getName() + " " + this->commandTokens_.subSet(2, this->commandTokens_.size()).join() + " " + CommandEvaluation::getCommonBegin(this->listOfPossibleArguments_));
     152                    {
     153                        if ((this->commandTokens_.size() - 2) >= this->function_->getParamCount())
     154                            return (this->functionclass_->getName() + " " + this->function_->getName() + " " + this->commandTokens_.subSet(2, this->commandTokens_.size()).join());
     155                        else
     156                            return (this->functionclass_->getName() + " " + this->function_->getName() + " " + this->commandTokens_.subSet(2, this->commandTokens_.size()).join() + " " + CommandEvaluation::getCommonBegin(this->listOfPossibleArguments_));
     157                    }
    147158                    else
    148159                        return (this->functionclass_->getName() + " " + this->function_->getName() + " ");
Note: See TracChangeset for help on using the changeset viewer.