zabuzo
Well-Known Member
- Joined
- Jun 10, 2016
- Messages
- 238
- Reaction score
- 54
I'm using the elevation system to make the famous parcel trap:
Its just this 3 changes made by mkalo:
Game.cpp:
Tile.cpp:
Tile.h:
But there is a bug to get down on montains
I mean, i can get up normally
as u can see on this imgs:
ibb.co
ibb.co
But i cant get down, with 3,4 parcels, nothing works
ibb.co
ibb.co
Why?
Its just this 3 changes made by mkalo:
Game.cpp:
Code:
ReturnValue Game::internalMoveCreature(Creature* actor, Creature* creature, Cylinder* fromCylinder, Cylinder* toCylinder, uint32_t flags/* = 0*/)
{
//check if we can move the creature to the destination
ReturnValue ret = toCylinder->__queryAdd(0, creature, 1, flags);
if(ret != RET_NOERROR)
return ret;
//height check
Tile* toTile = toCylinder->getTile();
Tile* fromTile = fromCylinder->getTile();
if(toTile->getHeight() - fromTile->getHeight() >= 2) {
return RET_NOTPOSSIBLE;
}
fromCylinder->getTile()->moveCreature(actor, creature, toCylinder);
if(creature->getParent() != toCylinder)
return RET_NOERROR;
Item* toItem = NULL;
Cylinder* subCylinder = NULL;
int32_t n = 0, tmp = 0;
while((subCylinder = toCylinder->__queryDestination(tmp, creature, &toItem, flags)) != toCylinder)
{
toCylinder->getTile()->moveCreature(actor, creature, subCylinder);
if(creature->getParent() != subCylinder) //could happen if a script move the creature
break;
toCylinder = subCylinder;
flags = 0;
if(++n >= MAP_MAX_LAYERS) //to prevent infinite loop
break;
}
return RET_NOERROR;
}
Tile.cpp:
Code:
int32_t Tile::getHeight() {
int32_t height = 0;
if(ground) {
if(ground->hasProperty(HASHEIGHT)) {
++height;
}
}
if(const TileItemVector* items = getItemList()) {
for(ItemVector::const_iterator it = items->begin(); it != items->end(); ++it) {
if((*it)->hasProperty(HASHEIGHT)) {
++height;
}
}
}
return height;
}
Tile.h:
Code:
int32_t getHeight();
But there is a bug to get down on montains
I mean, i can get up normally
as u can see on this imgs:
![ibb.co](/proxy.php?image=https%3A%2F%2Fi.ibb.co%2FjghYzWw%2FScreenshot-from-2019-12-09-00-45-16.png&hash=bae0da789648757a6f7ab752b499679a&return_error=1)
Screenshot-from-2019-12-09-00-45-16 hosted at ImgBB
Image Screenshot-from-2019-12-09-00-45-16 hosted in ImgBB
![ibb.co](/proxy.php?image=https%3A%2F%2Fsimgbb.com%2Fimages%2Ffavicon.png&hash=cc25ec9edbced437ec01c14bed536455&return_error=1)
![ibb.co](/proxy.php?image=https%3A%2F%2Fi.ibb.co%2F2vXXgjR%2FScreenshot-from-2019-12-09-00-45-04.png&hash=55ef922b0fbc40ffe0646104d7dda00a&return_error=1)
Screenshot-from-2019-12-09-00-45-04 hosted at ImgBB
Image Screenshot-from-2019-12-09-00-45-04 hosted in ImgBB
![ibb.co](/proxy.php?image=https%3A%2F%2Fsimgbb.com%2Fimages%2Ffavicon.png&hash=cc25ec9edbced437ec01c14bed536455&return_error=1)
But i cant get down, with 3,4 parcels, nothing works
![ibb.co](/proxy.php?image=https%3A%2F%2Fi.ibb.co%2FXDxZRjG%2FScreenshot-from-2019-12-09-00-44-49.png&hash=d3612d65fb6b56bd4bbffb4a18d2c318&return_error=1)
Screenshot-from-2019-12-09-00-44-49 hosted at ImgBB
Image Screenshot-from-2019-12-09-00-44-49 hosted in ImgBB
![ibb.co](/proxy.php?image=https%3A%2F%2Fsimgbb.com%2Fimages%2Ffavicon.png&hash=cc25ec9edbced437ec01c14bed536455&return_error=1)
![ibb.co](/proxy.php?image=https%3A%2F%2Fi.ibb.co%2Fp3bPN74%2FScreenshot-from-2019-12-09-00-44-27.png&hash=135471b21f7fea4d9a31f534488696cc&return_error=1)
Screenshot-from-2019-12-09-00-44-27 hosted at ImgBB
Image Screenshot-from-2019-12-09-00-44-27 hosted in ImgBB
![ibb.co](/proxy.php?image=https%3A%2F%2Fsimgbb.com%2Fimages%2Ffavicon.png&hash=cc25ec9edbced437ec01c14bed536455&return_error=1)
Why?