mehah / otclient

An alternative tibia client for otserv written in C++20 and Lua, made with a modular system that uses lua scripts for ingame interface and functionality, making otclient flexible and easy to customize

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

crash at startup

patrykq112 opened this issue · comments

Priority

Critical

Area

  • Data
  • Source
  • Docker
  • Other

What happened?

client crashes on startup after commit "perf: more fps and less memory usage"

image

What OS are you seeing the problem on?

Linux, Windows, MacOS

Code of Conduct

  • I agree to follow this project's Code of Conduct

Did you clean the project and compile it, or just recompile it?

I cleaned and compiled

try this:

in otclient\src\framework\core\graphicalapplication.cpp
image

replace for

    // THREAD - FOREGROUND UI
    threads.emplace_back(g_asyncDispatcher.submit_task([&] {
        std::unique_lock lock(uiPool->getMutexPreDraw());
        uiCond.wait(lock, [this]() {
            if (m_drawEvents->canDraw(DrawPoolType::MAP))
                g_ui.render(DrawPoolType::FOREGROUND);
            return m_stopping;
        });
    }));

    // THREAD - FOREGROUND MAP
    threads.emplace_back(g_asyncDispatcher.submit_task([&] {
        std::unique_lock lock(fgMapPool->getMutexPreDraw());
        fgMapCond.wait(lock, [this]() -> bool {
            if (m_drawEvents->canDraw(DrawPoolType::MAP))
                m_drawEvents->drawForgroundMap();
            return m_stopping;
        });
    }));
    ```

this replacement helped, it no longer crashes at the start

@mehah I found one more bug after this update. When opening a backpack, layout:getNumLines() always returns 0 and the backpacks open at the wrong height.

@patrykq112

try this:
add internalUpdate() at the end of the UIGridLayout::applyStyle() method

like this:

image

it didn't help, still the same

Could you give me an example, where are you executing this method so I can test it?

because everything seems normal to me.

image

@patrykq112
hmm, try this:
add

    if (m_parentWidget)
        m_parentWidget->onLayoutUpdate();

image

Could you give me an example, where are you executing this method so I can test it?

because everything seems normal to me.

image

game_containers/containers.lua

containerWindow:setContentMaximumHeight(cellSize.height * layout:getNumLines())

@mehah

2024-05-14.13-12-55.mp4

I found one more bug, the character names shake a lot when walking (it's most noticeable when moving at high speed)

@mehah

2024-05-14.13-12-55.mp4

fixed 6da6645

I found one more bug, the character names shake a lot when walking (it's most noticeable when moving at high speed)

I will look into this problem.

I found one more bug, the character names shake a lot when walking (it's most noticeable when moving at high speed)

fixed 84dca80