void Game::thingMoveInternal(Creature *creature, unsigned short from_x, unsigned short from_y, unsigned char from_z, unsigned char stackPos, unsigned short itemid, unsigned short to_x, unsigned short to_y, unsigned char to_z, unsigned char count) { Tile *fromTile = getTile(from_x, from_y, from_z); if(!fromTile) return; Tile *toTile = getTile(to_x, to_y, to_z); /* if(!toTile){ if(dynamic_cast(player)) dynamic_cast(player)->sendCancelWalk("Sorry, not possible..."); return; } */ Thing *thing = fromTile->getThingByStackPos(stackPos); #ifdef __DEBUG__ // std::cout << "moving" /* << ": from_x: "<< (int)from_x << ", from_y: "<< (int)from_y << ", from_z: "<< (int)from_z << ", stackpos: "<< (int)stackPos << ", to_x: "<< (int)to_x << ", to_y: "<< (int)to_y << ", to_z: "<< (int)to_z */ //<< std::endl; #endif if (!thing) return; Item* item = dynamic_cast(thing); Creature* creatureMoving = dynamic_cast(thing); Player* playerMoving = dynamic_cast(creatureMoving); Player* player = dynamic_cast(creature); Position oldPos; oldPos.x = from_x; oldPos.y = from_y; oldPos.z = from_z; #ifdef TP_TRASH_BINS if(toTile) { Thing *tothing = toTile->getThingByStackPos(stackPos); Item *toItem = dynamic_cast(tothing); if(item && toItem && !playerMoving && !creature && toItem->isDeleter()) { fromTile->removeThing(item); this->FreeThing(item); //creatureBroadcastTileUpdated(oldPos); sendRemoveThing(player, item->pos, item, stackPos); return; } } #endif //TP_TRASH_BINS // *** Creature moving itself to a non-tile if(!toTile && creatureMoving && creatureMoving == creature){ //change level begin Tile* downTile = getTile(to_x, to_y, to_z+1); //diagonal begin if(!downTile) { if (toTile) { ItemVector::iterator brn; for (brn = toTile->downItems.begin(); brn != toTile->downItems.end(); brn++) { if (creatureMoving && (*brn)->getID() == 1492 && creature != thing ) { creature->sendCancel("Sorry, not possible"); return; } } } if(player) { player->sendTextMessage(MSG_SMALLINFO, "Sorry, not possible."); player->sendCancelWalk(); } return; }