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*>(player))
dynamic_cast<Player*>(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<Item*>(thing);
Creature* creatureMoving = dynamic_cast<Creature*>(thing);
Player* playerMoving = dynamic_cast<Player*>(creatureMoving);
Player* player = dynamic_cast<Player*>(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<Item*>(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;
}
{"html5":"htmlmixed","css":"css","javascript":"javascript","php":"php","python":"python","ruby":"ruby","lua":"text\/x-lua","bash":"text\/x-sh","go":"go","c":"text\/x-csrc","cpp":"text\/x-c++src","diff":"diff","latex":"stex","sql":"sql","xml":"xml","apl":"apl","asterisk":"asterisk","c_loadrunner":"text\/x-csrc","c_mac":"text\/x-csrc","coffeescript":"text\/x-coffeescript","csharp":"text\/x-csharp","d":"d","ecmascript":"javascript","erlang":"erlang","groovy":"text\/x-groovy","haskell":"text\/x-haskell","haxe":"text\/x-haxe","html4strict":"htmlmixed","java":"text\/x-java","java5":"text\/x-java","jquery":"javascript","mirc":"mirc","mysql":"sql","ocaml":"text\/x-ocaml","pascal":"text\/x-pascal","perl":"perl","perl6":"perl","plsql":"sql","properties":"text\/x-properties","q":"text\/x-q","scala":"scala","scheme":"text\/x-scheme","tcl":"text\/x-tcl","vb":"text\/x-vb","verilog":"text\/x-verilog","yaml":"text\/x-yaml","z80":"text\/x-z80"}