edubart / otclient

An alternative tibia client for otserv written in C++11 and Lua, made with a modular system that uses lua scripts for ingame interface and functionality, making otclient flexible and easy to customize
Other
640 stars 402 forks source link

Update Effects.cpp for consistent behavior when rendering special patterns #1216

Closed LeandroLibanio28H closed 4 days ago

LeandroLibanio28H commented 3 months ago

The current rendering behavior of spell effects with patternX = 2 and patternY = 2 exhibits inconsistency, as demonstrated in the provided video:

https://github.com/edubart/otclient/assets/68310301/7160e498-f1a5-43da-9047-6e09b07e37e5

As an example, I've modified the "Eternal Winter" spell area to the following:

local area = {
    {0, 0, 0, 1, 0, 0, 0},
    {0, 0, 1, 1, 1, 0, 0},
    {0, 1, 1, 1, 1, 1, 0},
    {1, 1, 1, 2, 1, 1, 1},
    {0, 1, 1, 1, 1, 1, 0},
    {0, 0, 1, 1, 1, 0, 0},
    {0, 0, 0, 1, 0, 0, 0},
}

The spell pattern rendering is incompatible with the designated combat area. This pull request aims to rectify the issue by adjusting the effect rendering pattern formula to consistently align with the desired combat area, regardless of the pattern the object possesses.