• 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!

Error Attack/runes/magic in 'L'

In theory, that's how it works in Tibia RL CipSoft. That's how the line of sight is formulated.
I haven't tested it in Tibia RL, but you can confirm it yourself and let us know.
 
If you see in the print, on the left side it attacks all SQM, on the right side it doesn't even attack 'L';
Post automatically merged:

I'll send another example:

1740424981902.webp
 
Last edited:
I understand perfectly that you might think it's a bug, but that's how it works in Tibia RL. If you want, go and check it out.

On the other hand, if you dislike it so much, you can use the old line of sight. Simply revert these changes in your sources:


 
I understand perfectly that you might think it's a bug, but that's how it works in Tibia RL. If you want, go and check it out.

On the other hand, if you dislike it so much, you can use the old line of sight. Simply revert these changes in your sources:



Thank you for the help, but....
All changes were reverted, but the error still persists. Below is an example image after modifications:

1740898330878.webp

Does anyone have an idea how to solve it?

1740898464194.webp

see left sqm;

OTCv8-GM-2025-03-02-04-01-28.gif
 
Last edited:
I found out i had the same problem because of your post, both this

I understand perfectly that you might think it's a bug, but that's how it works in Tibia RL. If you want, go and check it out.

On the other hand, if you dislike it so much, you can use the old line of sight. Simply revert these changes in your sources:



and this worked for me, im using TFS 1.4.2

wow, yeah looks like it's broke and the commit doesn't fix it either.
Here's canarys code, not ideal but looks like it works on TFS 1.4.2, give it a test.

src\map.cpp replace checkSightLine
C++:
bool Map::checkSightLine(uint16_t x0, uint16_t y0, uint16_t x1, uint16_t y1, uint8_t z) const
{
    if (x0 == x1 && y0==y1) {
        return true;
    }

    Position start(x0,y0,z);
    Position destination(x1,y1,z);

    const int8_t mx = start.x < destination.x ? 1 : start.x == destination.x ? 0
        : -1;
    const int8_t my = start.y < destination.y ? 1 : start.y == destination.y ? 0
        : -1;

    int32_t A = Position::getOffsetY(destination, start);
    int32_t B = Position::getOffsetX(start, destination);
    int32_t C = -(A * destination.x + B * destination.y);

    while (start.x != destination.x || start.y != destination.y) {
        int32_t move_hor = std::abs(A * (start.x + mx) + B * (start.y) + C);
        int32_t move_ver = std::abs(A * (start.x) + B * (start.y + my) + C);
        int32_t move_cross = std::abs(A * (start.x + mx) + B * (start.y + my) + C);

        if (start.y != destination.y && (start.x == destination.x || move_hor > move_ver || move_hor > move_cross)) {
            start.y += my;
        }

        if (start.x != destination.x && (start.y == destination.y || move_ver > move_hor || move_ver > move_cross)) {
            start.x += mx;
        }

        if (!g_game.map.isTileClear(start.x, start.y, start.z)) {
            return false;
        }
    }

    return true;
}

Change Map::isSightClear
Code:
bool sightClear = checkSightLine(fromPos.x, fromPos.y, toPos.x, toPos.y, fromPos.z);
new:
Code:
bool sightClear = checkSightLine(fromPos.x, fromPos.y, toPos.x, toPos.y, fromPos.z) || checkSightLine(toPos.x, toPos.y, fromPos.x, fromPos.y, fromPos.z);

Still not 100% like i think it should be, but it got better than it was before

1741045408581.webp
1741045559307-webp.90694
 

Attachments

  • 1741045559307.webp
    1741045559307.webp
    46.1 KB · Views: 35 · VirusTotal
I found out i had the same problem because of your post, both this



and this worked for me, im using TFS 1.4.2



Still not 100% like i think it should be, but it got better than it was before

View attachment 90693
1741045559307-webp.90694
I will make these modifications and test them! Thank you very much for the information.


Update: Bug fixed!
 
Last edited:
Back
Top