Thaian Citizen
Hexenjäger
Hello, when I try to compile I get the following error:
But my function getHeight() is defined properly?
Tile.cpp:
Tile.h:
game.cpp:
I know it's a simple misstake if there's one..
But I can't seem to find it
Your help is appreciated
game.o: In function `Game::internalMoveCreature(Creature*, Direction, unsigned int)':
/root/****/source/game.cpp:1038: undefined reference to `Tile::getHeight() const'
/root/****/source/game.cpp:1038: undefined reference to `Tile::getHeight() const'
/root/****/source/game.cpp:1036: undefined reference to `Tile::getHeight() const'
/root/****/source/game.cpp:1040: undefined reference to `Tile::getHeight() const'
game.o: In function `Game:layerMoveCreature(unsigned int, unsigned int, Position const&, Position const&)':
/root/****/source/game.cpp:899: undefined reference to `Tile::getHeight() const'
collect2: error: ld returned 1 exit status
make[1]: *** [otserv] Error 1
make[1]: Leaving directory `/root/****/source'
make: *** [all] Error 2
******:~/****/source#
But my function getHeight() is defined properly?
Tile.cpp:
Code:
int32_t Tile::getHeight() const
{
uint32_t height = 0;
Item* iiItem = NULL;
for(uint32_t i = 0; i < getThingCount(); ++i){
iiItem = __getThing(i)->getItem();
if(iiItem && iiItem->hasProperty(HASHEIGHT))
++height;
}
return height;
}
Tile.h:
Code:
// under this class, public
class Tile : public Cylinder
{
public:
int32_t getHeight() const;
...
game.cpp:
Code:
//this the lines calling the getHeight()
toTile = getTile(destPos);
// ACERON TRYING TO IMPLEMENT STACKED BLOCK
Tile* toPos = getTile(destPos.x, destPos.y, destPos.z);
Tile* fromPos = getTile(currentPos.x, currentPos.y, currentPos.z);
ReturnValue ret = RET_NOTPOSSIBLE;
if(toTile != NULL){
// Can't walk over items with height >= 2
if (currentPos.z > destPos.z && toPos->getHeight() > 1);
// not possible
else if ((((toPos->getHeight() - fromPos->getHeight()) < 2)) ||
(fromPos->hasHeight(3) && (currentPos.z == destPos.z)) ||
((currentPos.z < destPos.z) && (toPos->hasHeight(3) && (fromPos->getHeight() < 2))))
ret = internalMoveCreature(creature, fromTile, toTile, flags);
}
if(ret != RET_NOERROR){
if(Player* player = creature->getPlayer()){
player->sendCancelMessage(ret);
player->sendCancelWalk();
}
}
I know it's a simple misstake if there's one..
But I can't seem to find it
Your help is appreciated
Last edited: