Skip to content

fix: handle floor-change tiles in walk logic#1494

Merged
mehah merged 2 commits intoopentibiabr:mainfrom
divinity76:floorchange-walkable
Dec 23, 2025
Merged

fix: handle floor-change tiles in walk logic#1494
mehah merged 2 commits intoopentibiabr:mainfrom
divinity76:floorchange-walkable

Conversation

@divinity76
Copy link
Copy Markdown
Contributor

@divinity76 divinity76 commented Dec 20, 2025

Description

Propagate ThingAttrFloorChange into flags/tiles/Lua and use it when deciding whether to step between floors.

partially fix #1422 this allows walking down more floors on 7.6
(but not all - seems some floors are missing the floorChange attribute in tibia.dat ? at least the bundle from https://download.otservlist.org/client/tibia76.zip seems to have some floors missing the floorChange attribute. )

Behavior

Trying to walk down the floors south of spawning point on tibiafun.hopto.org
Image

Actual

mehah/otclient refuse to walk down the stairs.

Expected

should walk down the stairs

Fixes

(partially fixes 1422 ?)

Type of change

Please delete options that are not relevant.

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

How Has This Been Tested

Walk down stairs south of spawn on http://tibiafun.hotop.org

Test Configuration:

  • Server Version: (Modified YurOTS0.9.4F?)
  • Client: git master, protocol 760
  • Operating System: Both Ubuntu24.04 and Windows 10

Checklist

  • My code follows the style guidelines of this project
  • I have performed a self-review of my own code
  • I checked the PR checks reports
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works

Propagate ThingAttrFloorChange into flags/tiles/Lua and use it when deciding whether to step between floors.

partilly fix opentibiabr#1422
this allows walking down more floors on 7.6
(but not all - seems some floors are missing the floorChange attribute
in tibia.dat ? at least the bundle from https://download.otservlist.org/client/tibia76.zip
seems to have some floors missing the floorChange attribute. )
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR adds support for the FloorChange attribute to enable proper walking down stairs in older Tibia client protocols (7.4-7.72). The FloorChange attribute is propagated from the protobuf definitions through the C++ type system to Lua bindings, and the walk logic is updated to check for this attribute when determining if floor transitions are allowed.

Key Changes

  • Added FloorChange attribute support in protobuf, ThingType flags, Thing, and Tile classes
  • Updated walk.lua to check for hasFloorChange() when walking down floors
  • Exposed hasFloorChange() method to Lua for use in game logic

Reviewed changes

Copilot reviewed 10 out of 10 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
src/protobuf/appearances.proto Adds optional floorchange field to AppearanceFlags for protobuf serialization
src/client/tile.h Declares hasFloorChange() method for Tile class
src/client/tile.cpp Implements hasFloorChange() by checking if any thing on the tile has the floor change attribute
src/client/thingtype.h Adds hasFloorChange() method to check ThingFlagAttrFloorChange flag
src/client/thingtype.cpp Adds floor change flag handling in appearance deserialization and attribute mapping
src/client/thing.h Declares hasFloorChange() method for Thing class
src/client/thing.cpp Implements hasFloorChange() by delegating to ThingType
src/client/luafunctions.cpp Binds hasFloorChange() methods to Lua for ThingType and Tile
src/client/const.h Adds ThingFlagAttrFloorChange flag constant
modules/game_walk/walk.lua Updates floor change logic to check for floor change attribute when walking down

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@sonarqubecloud
Copy link
Copy Markdown

@majestyotbr majestyotbr changed the title Handle floor-change tiles in walk logic fix: handle floor-change tiles in walk logic Dec 20, 2025
@mehah mehah merged commit 4ff2d4b into opentibiabr:main Dec 23, 2025
9 of 10 checks passed
@javiertringol
Copy link
Copy Markdown
Contributor

@divinity76 Where did you get that from?
image

@divinity76
Copy link
Copy Markdown
Contributor Author

@divinity76 Where did you get that from?

Nowhere, was just the first available id. Do you think it matters somehow? Should it interface with anything?

libergod added a commit to gabrielew/otclient that referenced this pull request Jan 5, 2026
commit 5c276fa
Author: André Morais <[email protected]>
Date:   Mon Jan 5 12:15:09 2026 -0300

    fix: cyclopedia map (opentibiabr#1545)

commit 62f9bb5
Author: divinity76 <[email protected]>
Date:   Mon Jan 5 16:13:36 2026 +0100

    fix: remove vBot upstream version check (opentibiabr#1547)

commit b967b44
Author: Renato Machado <[email protected]>
Date:   Sun Jan 4 20:55:57 2026 -0300

    fix(drawpool): guard against nullptr coords when batching

commit 3db1163
Author: Renato Machado <[email protected]>
Date:   Sun Jan 4 17:16:21 2026 -0300

    fix: auto-repaint for foreground and map when shader is enabled

commit a751caf
Author: Gabriel Alcântara Bernardes <[email protected]>
Date:   Sun Jan 4 10:59:31 2026 -0300

    fix: bestiary search (opentibiabr#1536)

commit 7518e6b
Author: divinity76 <[email protected]>
Date:   Sat Jan 3 14:55:39 2026 +0100

    fix(vbot):  item list scroll to bottom on new entry (opentibiabr#1530)

commit 5466028
Author: kokekanon <[email protected]>
Date:   Sat Jan 3 10:55:06 2026 -0300

    fix(vbot): typo in method name: 'hasCreature' to 'hasCreatures' (opentibiabr#1534)

commit a4bd7d4
Author: divinity76 <[email protected]>
Date:   Sat Jan 3 04:26:14 2026 +0100

    fix(vbot): Expose Directions to bot sandbox (opentibiabr#1533)

    Allow doing
    ```lua
    g_game.walk(Directions.South)
    ```
    instead of
    ```lua
    g_game.walk(2)
    ```
    in cavebot waypoint Functions.

    Was in a situation where I needed the cavebot to walk exactly 1 sqm south, and the cavebot's built-in "Go To" command is not reliable for that, when you need precision walking.

commit 8f2959d
Author: Copilot <[email protected]>
Date:   Fri Jan 2 22:04:04 2026 +0100

    fix: auto loot distance check (opentibiabr#1525)

commit 4067a07
Author: kokekanon <[email protected]>
Date:   Fri Jan 2 16:01:03 2026 -0300

    fix: violation rule Windows length opentibiabr#1519 (opentibiabr#1522)

commit e4a07ec
Author: kokekanon <[email protected]>
Date:   Thu Jan 1 17:02:18 2026 -0300

    rollback: UIItem onClick fix vbot issues opentibiabr#1520 (opentibiabr#1521)

commit 1e2da94
Author: Renato Machado <[email protected]>
Date:   Tue Dec 30 19:08:27 2025 -0300

    improve: use GameDoublePlayerGoodsMoney flag instead of version check for u64 money support

commit b47799e
Author: Gabriel Alcântara Bernardes <[email protected]>
Date:   Tue Dec 30 16:40:47 2025 -0300

    feat: stash stow items (opentibiabr#1480)

commit a6856e0
Author: Renato Machado <[email protected]>
Date:   Tue Dec 30 15:43:39 2025 -0300

    Revert "fix: detection of Vorbis, VorbisFile and OGG in CMake for non-Windows targets (opentibiabr#1508)"

    This reverts commit 8b68c8b.

commit 8b68c8b
Author: grepwood <[email protected]>
Date:   Tue Dec 30 18:30:42 2025 +0100

    fix: detection of Vorbis, VorbisFile and OGG in CMake for non-Windows targets (opentibiabr#1508)

commit 3fe17bf
Author: Renato Machado <[email protected]>
Date:   Tue Dec 30 13:20:28 2025 -0300

    perf: parallelize draw pipeline (FOREGROUND starts collecting without waiting MAP preLoad) (opentibiabr#1510)

commit 0c17f86
Author: Renato Machado <[email protected]>
Date:   Tue Dec 30 13:20:17 2025 -0300

    feat: add public config.ini support for client-exposed settings (opentibiabr#1513)

commit b263bc8
Author: kokekanon <[email protected]>
Date:   Tue Dec 30 13:18:32 2025 -0300

    fix: hook flag in protobuf opentibiabr#1482 (opentibiabr#1517)

commit a43c1ca
Author: kokekanon <[email protected]>
Date:   Tue Dec 30 13:18:17 2025 -0300

    fix: modules html opentibiabr#1505 opentibiabr#1506 (opentibiabr#1516)

commit ce858a2
Author: SkullzOTS <[email protected]>
Date:   Tue Dec 30 13:17:38 2025 -0300

    fix: android (opentibiabr#1515)

commit a7251bc
Author: André Morais <[email protected]>
Date:   Tue Dec 30 01:30:37 2025 -0300

    fix: market value format (opentibiabr#1509)

commit 6e2c568
Author: javiertringol <[email protected]>
Date:   Mon Dec 29 14:04:56 2025 -0300

    fix: opentibiabr#1501 Mouse Control Mode save (opentibiabr#1503)

commit 285a906
Author: Renato Machado <[email protected]>
Date:   Mon Dec 29 13:01:49 2025 -0300

    perf: streamline DrawPool repaint flow and reduce hot-path overhead

    Refines the DrawPool repaint flow by simplifying canRepaint() and adjusting release() / repaint() to avoid unnecessary work. Reduces synchronization overhead by switching hot-path atomics to memory_order_relaxed (e.g. LightView, TextureAtlas), removes redundant logic in DrawPoolManager’s pre-draw flow, and makes draw-hash reset behavior more consistent.

    Results: +5.46% performance

commit 5bbc87d
Author: Renato Machado <[email protected]>
Date:   Fri Dec 26 23:14:30 2025 -0300

    chore: cleanup attachedEffect

commit fe99915
Author: Renato Machado <[email protected]>
Date:   Fri Dec 26 23:12:13 2025 -0300

    feat: add followOwner flag to the attachedEffect system so effects can follow the owner during bounce

commit ccdb09b
Author: Renato Machado <[email protected]>
Date:   Fri Dec 26 18:47:54 2025 -0300

    fix: don’t force creature bounce on attached effects

    Attached effects should not automatically inherit the owner’s bounce. When needed, reuse the same bounce/elevation data used by the creature. For visuals that must always stay bound to the character (e.g., wings), use the paperdoll system.

commit aafef1c
Author: Renato Machado <[email protected]>
Date:   Wed Dec 24 13:46:36 2025 -0300

    feat: paperdoll (Ho Ho Ho!!!) (opentibiabr#1500)

commit b3bee2b
Author: Avaji <[email protected]>
Date:   Tue Dec 23 14:41:31 2025 -0500

    fix: Adding datdump cpp/h to vcxproj (opentibiabr#1499)

commit 318ed83
Author: divinity76 <[email protected]>
Date:   Tue Dec 23 19:18:15 2025 +0100

    feat: add dat dump cli (opentibiabr#1492)

commit 4ff2d4b
Author: divinity76 <[email protected]>
Date:   Tue Dec 23 18:09:41 2025 +0100

    fix: handle floor-change tiles in walk logic (opentibiabr#1494)

commit 3442323
Author: divinity76 <[email protected]>
Date:   Tue Dec 23 18:04:21 2025 +0100

    fix: f(char*) f(std::string) + replace c_str() with data() (opentibiabr#1485)

commit 0005d3e
Author: divinity76 <[email protected]>
Date:   Tue Dec 23 18:04:06 2025 +0100

    fix: optimize color tolower (opentibiabr#1490)

commit 81ccbd8
Author: divinity76 <[email protected]>
Date:   Tue Dec 23 18:03:48 2025 +0100

    ci/cd: fix emscripten build (opentibiabr#1491)

commit 7b132aa
Author: Luan Luciano <[email protected]>
Date:   Sun Dec 21 12:06:28 2025 -0300

    feat: compatibility with 15.11 (only bytes)

    Co-authored-by: kokekanon <[email protected]>

commit 9d485b5
Author: divinity76 <[email protected]>
Date:   Sat Dec 20 02:04:21 2025 +0100

    fix: cleanup unused sha1 (opentibiabr#1486)

commit dad1f4d
Author: Renato Machado <[email protected]>
Date:   Thu Dec 18 21:41:54 2025 -0300

    fix(localplayer): avoid forced step to next tile when overlapping passable creatures (thx @nekiro)

commit 0646982
Author: divinity76 <[email protected]>
Date:   Tue Dec 16 17:06:20 2025 +0100

    fix: capacity scaling for 7.6 protocol

    Co-authored-by: kokekanon <[email protected]>

commit eb656a7
Author: Renato Machado <[email protected]>
Date:   Sun Dec 7 16:07:50 2025 -0300

    fix: avoid concurrent thing texture loading with atomic flag

commit dc2ff31
Author: Renato Machado <[email protected]>
Date:   Sun Dec 7 16:03:15 2025 -0300

    fix: rare crash on close client

commit 1d26861
Author: Renato Machado <[email protected]>
Date:   Sat Dec 6 14:24:44 2025 -0300

    fix(hash): resolve compilation issues on x86 platforms

commit 730835a
Author: Renato Machado <[email protected]>
Date:   Fri Dec 5 23:33:10 2025 -0300

    fix(hud): make crosshair and attached widgets respect HUD scale (fix opentibiabr#1436)

commit 3aa478e
Author: Renato Machado <[email protected]>
Date:   Fri Dec 5 23:13:07 2025 -0300

    fix(draw): wait for all draw pools to finish before processing next cycle (fix opentibiabr#1472)

commit 8a0d43b
Author: Renato Machado <[email protected]>
Date:   Fri Dec 5 22:27:35 2025 -0300

    fix(drawpool): set repaint flag only after preparing draw objects

commit a47fdf2
Author: Renato Machado <[email protected]>
Date:   Fri Dec 5 22:25:03 2025 -0300

    feat(drawpool): add hash support to addAction

commit cb29a60
Author: Renato Machado <[email protected]>
Date:   Fri Dec 5 19:51:35 2025 -0300

    fix: ThingType loading sets default boolean to false

commit 66c2ad7
Author: kokekanon <[email protected]>
Date:   Tue Dec 2 11:04:00 2025 -0300

    fix: skill Miniwindows in Old protocol (opentibiabr#1477)

commit acc928e
Author: Renato Machado <[email protected]>
Date:   Sun Nov 30 20:53:30 2025 -0300

    feat: add recursive loading for style files

commit 8fa1bce
Author: kokekanon <[email protected]>
Date:   Fri Nov 28 14:42:43 2025 -0300

    fix: protocol 12.91 (opentibiabr#1478)

commit fa77ad0
Author: Renato Machado <[email protected]>
Date:   Mon Nov 24 21:21:08 2025 -0300

    improve: use `addEvent` instead of `scheduleEvent` to trigger the `onGameStart` event

commit fc57601
Author: Renato Machado <[email protected]>
Date:   Mon Nov 24 20:03:01 2025 -0300

    feat: enable atlas in UI (opentibiabr#1471)

commit 806c9c7
Author: Renato Machado <[email protected]>
Date:   Mon Nov 24 19:51:52 2025 -0300

    chore: cleanup leftover anti-bot logic

commit 7d57547
Author: kokekanon <[email protected]>
Date:   Sun Nov 23 21:56:52 2025 -0300

    fix: compilation Encryption Mode (opentibiabr#1474)

commit c0dd2a7
Author: kokekanon <[email protected]>
Date:   Sun Nov 23 21:56:46 2025 -0300

    fix: compilation in FRAMEWORK_EDITOR (opentibiabr#1473)

commit 7cd36e2
Author: kokekanon <[email protected]>
Date:   Sat Nov 22 10:23:43 2025 -0300

    fix: prevent ERROR: /game_battle/battle.lua:20: stack overflow (opentibiabr#1470)

commit 8ffba36
Author: kokekanon <[email protected]>
Date:   Fri Nov 21 20:55:38 2025 -0300

    fix: opentibiabr#1460 Failed to fetch sprite (opentibiabr#1468)

commit 34c52dc
Author: kokekanon <[email protected]>
Date:   Fri Nov 21 16:21:07 2025 -0300

    fix. NPC message text duplication in console (opentibiabr#1469)

commit a6ee810
Author: kokekanon <[email protected]>
Date:   Thu Nov 20 21:49:23 2025 -0300

    fix: prevent WARNING: Lua warning: member function call skipped becau… (opentibiabr#1467)

commit f726bb0
Author: SkullzOTS <[email protected]>
Date:   Thu Nov 20 16:55:02 2025 -0300

    feat: dragging item icon (opentibiabr#1466)

commit 67460c0
Author: Eduardo Dantas <[email protected]>
Date:   Thu Nov 20 02:08:02 2025 -0300

    refactor: string encoding to use utf8cpp and add tests (opentibiabr#1443)

    Update string encoding implementation to use utf8cpp

    This change updates the string encoding implementation to use the utf8cpp library for improved robustness and consistency across platforms. It refactors the encoding functions in src/framework/stdext/string.cpp, adds comprehensive unit tests, updates build configurations to include utf8cpp, and documents the new encoding policy and behavior.

    String encoding improvements

    Refactored all string encoding functions in src/framework/stdext/string.cpp to use the utf8cpp library, providing strict UTF-8 validation, robust conversions between UTF-8, Latin-1, and UTF-16, and consistent error handling.

    Added a new documentation file docs/string-encoding-policy.md detailing the updated encoding policy, error handling, dependencies, and testing strategy.

    Testing enhancements

    Added a new unit test suite in tests/stdext/string_encoding_test.cpp covering UTF-8 validation, conversions, roundtrip consistency, control character handling, and platform-specific UTF-16 conversions.

    Updated the test build configuration to include the new test directory and sources.

    Build system updates

    Updated src/CMakeLists.txt to require and link the utf8cpp library for all platforms, ensuring proper integration.

    Added utf8cpp as a dependency in vcpkg.json for package management.

commit bf6e3c5
Author: cynio <[email protected]>
Date:   Wed Nov 19 22:32:45 2025 +0100

    fix(game_console): WASD toggle for game_hotkeys (opentibiabr#1461)
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.

7.6 unable to walk down lots of stairs

4 participants