bool Game::playerTurn(uint32_t playerId, Direction dir)
{
Player* player = getPlayerByID(playerId);
if(!player || player->isRemoved())
return false;
if(internalCreatureTurn(player, dir))
{
player->setIdleTime(0);
return true;
}
if(player->getDirection() != dir || !player->hasCustomFlag(PlayerCustomFlag_CanTurnhop))
return false;
Position pos = getNextPosition(dir, player->getPosition());
Tile* tile = map->getTile(pos);
if(!tile || !tile->ground)
return false;
player->setIdleTime(0);
ReturnValue ret = tile->__queryAdd(0, player, 1, FLAG_IGNOREBLOCKITEM);
if (ret != RET_NOTENOUGHROOM && (ret != RET_NOTPOSSIBLE ||...
search hardercould any1 help with walking with ctrl and arrow ?? sure for gms i searched alot but found nothing
do u know where to edit ???It took me 24 hours to find this: https://otland.net/threads/event-walkthrough-everything-ctrl-arrow-keys-tfs-1-x.226973/
Since probably it won't work for you, at least you can see the structure of the script and build your one for TFS 0.4.
bool Game::playerTurn(uint32_t playerId, Direction dir)
{
Player* player = getPlayerByID(playerId);
if(!player || player->isRemoved())
return false;
if(internalCreatureTurn(player, dir))
{
player->setIdleTime(0);
return true;
}
if(player->getDirection() != dir || !player->hasCustomFlag(PlayerCustomFlag_CanTurnhop))
return false;
Position pos = getNextPosition(dir, player->getPosition());
Tile* tile = map->getTile(pos);
if(!tile || !tile->ground)
return false;
player->setIdleTime(0);
ReturnValue ret = tile->__queryAdd(0, player, 1, FLAG_IGNOREBLOCKITEM);
if (ret != RET_NOTENOUGHROOM && (ret != RET_NOTPOSSIBLE || player->hasCustomFlag(PlayerCustomFlag_CanMoveAnywhere))
&& (ret != RET_PLAYERISNOTINVITED || player->hasFlag(PlayerFlag_CanEditHouses)))
return internalTeleport(player, pos, true);
player->sendCancelMessage(ret);
return false;
}