• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!

OTClient TFS 1.3 no creature found to move

Gicu

Well-Known Member
Joined
Feb 26, 2011
Messages
187
Reaction score
52
Like on SS
TFS 1.3 latest i compiling with [Tutorial] Adding more tiles to game window - Updated 7/6/2018 (https://otland.net/threads/tutorial-adding-more-tiles-to-game-window-updated-7-6-2018.228243/)
and OTClient i latest too
Maybe here is error?

Lua:
void ProtocolGame::sendMoveCreature(const Creature* creature, const Position& newPos, int32_t newStackPos, const Position& oldPos, int32_t oldStackPos, bool teleport)
{
    if (creature == player) {
        if (oldStackPos >= 10) {
            sendMapDescription(newPos);
        } else if (teleport) {
            NetworkMessage msg;
            RemoveTileThing(msg, oldPos, oldStackPos);
            writeToOutputBuffer(msg);
            sendMapDescription(newPos);
        } else {
            NetworkMessage msg;
            if (oldPos.z == 7 && newPos.z >= 8) {
                RemoveTileThing(msg, oldPos, oldStackPos);
            } else {
                msg.addByte(0x6D);
                msg.addPosition(oldPos);
                msg.addByte(oldStackPos);
                msg.addPosition(newPos);
            }

            if (newPos.z > oldPos.z) {
                MoveDownCreature(msg, creature, newPos, oldPos);
            } else if (newPos.z < oldPos.z) {
                MoveUpCreature(msg, creature, newPos, oldPos);
            }

if (oldPos.y > newPos.y) { // north, for old x
   msg.addByte(0x65);
   GetMapDescription(oldPos.x - Map::maxClientViewportX, newPos.y - Map::maxClientViewportY, newPos.z, (Map::maxClientViewportX+1)*2, 1, msg);
} else if (oldPos.y < newPos.y) { // south, for old x
   msg.addByte(0x67);
   GetMapDescription(oldPos.x - Map::maxClientViewportX, newPos.y + (Map::maxClientViewportY+1), newPos.z, (Map::maxClientViewportX+1)*2, 1, msg);
}
if (oldPos.x < newPos.x) { // east, [with new y]
   msg.addByte(0x66);
   GetMapDescription(newPos.x + (Map::maxClientViewportX+1), newPos.y - Map::maxClientViewportY, newPos.z, 1, (Map::maxClientViewportY+1)*2, msg);
} else if (oldPos.x > newPos.x) { // west, [with new y]
   msg.addByte(0x68);
   GetMapDescription(newPos.x - Map::maxClientViewportX, newPos.y - Map::maxClientViewportY, newPos.z, 1, (Map::maxClientViewportY+1)*2, msg);
}
            writeToOutputBuffer(msg);
        }
    } else if (canSee(oldPos) && canSee(creature->getPosition())) {
        if (teleport || (oldPos.z == 7 && newPos.z >= 8) || oldStackPos >= 10) {
            sendRemoveTileThing(oldPos, oldStackPos);
            sendAddCreature(creature, newPos, newStackPos, false);
        } else {
            NetworkMessage msg;
            msg.addByte(0x6D);
            msg.addPosition(oldPos);
            msg.addByte(oldStackPos);
            msg.addPosition(creature->getPosition());
            writeToOutputBuffer(msg);
        }
    } else if (canSee(oldPos)) {
        sendRemoveTileThing(oldPos, oldStackPos);
    } else if (canSee(creature->getPosition())) {
        sendAddCreature(creature, newPos, newStackPos, false);
    }
}
 

Attachments

Last edited:
Back
Top