Skip to content

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

Merged
Nottinghster merged 1 commit intoopentibiabr:mainfrom
LeandroLibanio28H:main
Apr 2, 2024
Merged

Update Effects.cpp for consistent behavior when rendering special patterns#734
Nottinghster merged 1 commit intoopentibiabr:mainfrom
LeandroLibanio28H:main

Conversation

@LeandroLibanio28H
Copy link
Copy Markdown
Contributor

Description

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

Behavior

Actual

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 produced the following behavior:

wrong_effect_rendering.mp4

The animation renders correctly on certain sqms but not others, exhibiting inconsistent behavior.

Expected

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.

right_effect_rendering.mp4

Type of change

  • Bug fix (non-breaking change which fixes an issue)

How to test and reproduce

  1. Create or modify a spell and use the CONST_ME_ICETORNADO, CONST_ME_BIGCLOUDS, or any effect whose pattern is not x = 1, y = 1.
  2. Open the client and try the spell
  3. Move one sqm and try it again (The rendering will be broken every other sqm)
  4. Apply the changes on this PR
  5. Try it again (The rendering is consistent)
  6. Try effects that have another pattern setup and verify that the change didn't break them.

Test Configuration:

  • Server Version: TFS 1.4.2
  • Client: Mehah otclient (master)
  • Operating System: Windows 11

Checklist

  • My code follows the style guidelines of this project
  • I have performed a self-review of my own code
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works

@Nottinghster Nottinghster merged commit fe17f5b into opentibiabr:main Apr 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants