Skip to content

Fix black and red squares behaviors#902

Merged
luanluciano93 merged 4 commits intoopentibiabr:mainfrom
OTArchive:squares
Oct 6, 2024
Merged

Fix black and red squares behaviors#902
luanluciano93 merged 4 commits intoopentibiabr:mainfrom
OTArchive:squares

Conversation

@OTArchive
Copy link
Copy Markdown
Contributor

@OTArchive OTArchive commented Oct 4, 2024

Description

Black squares are not showing around attacking creatures, and the red target square disappears when you are attacked.

Expected

Black squares on attacking creatures and red square when you are attacking.

Fixes

Please help me understand this so we can code a proper solution.
In ProtocolGame::parseCreaturesMark, if I set "isPermanent" to false, the squares issues seem to get solved:

image

2024-10-04.15-20-06.mp4

Canary and TFS always sends 0x01 for "isPermanent":
Server side reference

Am I missing something? Should squares always be timedSquares?

Fixes #898

@OTArchive OTArchive changed the title Fix square behaviors Fix black and red squares behaviors Oct 5, 2024
@luanluciano93
Copy link
Copy Markdown
Contributor

If the server sent: U32, U8 and U8, you must receive these bytes, even if you are not going to use them.

@OTArchive
Copy link
Copy Markdown
Contributor Author

OTArchive commented Oct 6, 2024

If the server sent: U32, U8 and U8, you must receive these bytes, even if you are not going to use them.

Yeah, but any idea why the current implementation is broken? Should squares always be timedSquares?

@luanluciano93
Copy link
Copy Markdown
Contributor

if the problem is in isPermanent, just receive the byte and don't define it in the variable:

        msg->getU8();
        const bool isPermanent = false;

Anyway, it's interesting to test on an older version to see if the behavior is the same.

@OTArchive
Copy link
Copy Markdown
Contributor Author

if the problem is in isPermanent, just receive the byte and don't define it in the variable:

        msg->getU8();
        const bool isPermanent = false;

Anyway, it's interesting to test on an older version to see if the behavior is the same.

Sure, but that would leave dead code, right?
You are right, we should look into older versions.

@OTArchive
Copy link
Copy Markdown
Contributor Author

OTArchive commented Oct 6, 2024

If the server sent: U32, U8 and U8, you must receive these bytes, even if you are not going to use them.

Turns out that using the byte in Canary 13.40 breaks it again

8.6 server reference:
https://github.com/otservme/global860/blob/571183a2858e638d49778cca914c8126bd6f17ce/sources/protocolgame.cpp#L1613

- Set black squares color to 1 instead of 0 so it's not treated as alpha
- Fix creaturesMark logic so red squares don't disappear when attacking and black squares show when attacked
jordanhoare added a commit to tibia-oce/otclient that referenced this pull request Oct 11, 2024
* perf: Drawpool 3.1

more stability in FPS

* setting m_effectAlpha, m_missileAlpha to 1.f

* fix: display density on mapview

* feat: hud scale

* fix: Interface Anchors (opentibiabr#862)

* feat: support directx

* improve: use egl v3

* small change in gc

* fix: memory leak in controller

* improve: organization of the project structure

* add new config to draw covered things

There are projects where this system doesn't work very well, so if your project is one of those, just set it to true to fix the tiles that aren't being drawn.

* feat: update background image and startup sound to use 13.40 cip files. Adjustments in options buttons order and logout button icon. (opentibiabr#865)

* update UIGraph (need test)

* fix shader warning

* fix: console error due to shaders

* draw-covered-things to false

Note: Setting false will not draw objects that the client understands are covered. If for some reason a tile is not being drawn because your game is custom, set this property to true and this issue will be resolved.

* baseline updated (update your vcpkg)

git pull

* Revert "baseline updated (update your vcpkg)"

This reverts commit 8dda995.

* fix: opentibiabr#867

* feat: extractTexture in framebuffer, Arch SS2 by default and cleanup

* fix: inverted texture in extractTexture

* html: support tag img

* perf: reducing locking, thus increasing performance a little.

* fix draw shader

* prevent crash in static text

* improve: add lua call protection

* perf: improve propagateOnMouseMove

* fix: bot item ondrop and analyzer loot channel (opentibiabr#887)

* fix: outfit size , prevent ERROR: invalid thing (opentibiabr#884)

Co-authored-by: Rodrigo Paixão <god.rodrigo@hotmail.com>

* improve: HTTP login error handling to display login.php error messages (opentibiabr#886)

* fix: compilation error on some pcs

* feat: full cyclopedia module (opentibiabr#868)

* fix: game_store bugs. fix: opentibiabr#873 (opentibiabr#874)

* feat: Minimap GM teleport ( ctrl +shift + click on minimap) (opentibiabr#885)

Co-authored-by: Luan Luciano <luanluciano@outlook.com>

* support "Mage" vocation (opentibiabr#882)

several OT servers merge MS/ED vocation into a Mage vocation having the best features of both MS and ED.

Without this fix, on those servers, vBot would constantly error out with Error: (...) concatenat voc: a nil value

* fix (opentibiabr#900)

* improve parseOpenContainer and fix error with decoration kit (opentibiabr#890)

* fix: optional display rarity colors in items . feature GameColorizedLootValue 12.00 (opentibiabr#896)

* fix: crash getItems (opentibiabr#892)

* looting blacklist (opentibiabr#881)

When "loot every item" is off, it will loot everything in the loot list.

When "loot every item" is on, it will loot everything that is not in the loot list, effectively making the loot list a blacklist when "loot every item" is on.

* Fix black and red squares behaviors (opentibiabr#902)


* Fix squares:
- Set black squares color to 1 instead of 0 so it's not treated as alpha
- Fix creaturesMark logic so red squares don't disappear when attacking and black squares show when attacked

* feat: display tier UI (GameThingUpgradeClassification) (opentibiabr#895)

* feat: Vips Groups | fix issue: opentibiabr#730 (opentibiabr#908)

* fix: spacing for align bottom vertical layouts (opentibiabr#909)

* Fix: opentibiabr#901

---------

Co-authored-by: Renato Machado <mehahx@gmail.com>
Co-authored-by: SkullzOTS <86809689+SkullzOTS@users.noreply.github.com>
Co-authored-by: Luan Luciano <luanluciano@outlook.com>
Co-authored-by: Felipe Muniz <felipe.silva@virtus.ufcg.edu.br>
Co-authored-by: Rodrigo Paixão <god.rodrigo@hotmail.com>
Co-authored-by: kokekanon <114332266+kokekanon@users.noreply.github.com>
Co-authored-by: divinity76 <divinity76@gmail.com>
Co-authored-by: divinity76 <hans@loltek.net>
Co-authored-by: OT Archive <112215823+OTArchive@users.noreply.github.com>
Co-authored-by: Marcin Jałocha <nekiro.dev@gmail.com>
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.

Attack square dissapears

3 participants