mirror of
https://github.com/luanti-org/luanti.git
synced 2025-07-02 16:38:41 +00:00
Client & ClientEnvirnment: don't create fake events (#5676)
Instead of create fake events on the stack on each loop call (Game::run), verify is queue is empty or not and handle event directly if there is. This prevents fake ClientEvent creation & memory allocations Same fix is also applied on ClientEnvironment, & rename getClientEvent to getClientEnvEvent to match ClientEnvEvent object
This commit is contained in:
parent
f727f54192
commit
3db66b4531
5 changed files with 27 additions and 33 deletions
|
@ -126,8 +126,9 @@ public:
|
|||
void getActiveObjects(v3f origin, f32 max_d,
|
||||
std::vector<DistanceSortedActiveObject> &dest);
|
||||
|
||||
// Get event from queue. CEE_NONE is returned if queue is empty.
|
||||
ClientEnvEvent getClientEvent();
|
||||
bool hasClientEnvEvents() const { return !m_client_event_queue.empty(); }
|
||||
// Get event from queue. If queue is empty, it triggers an assertion failure.
|
||||
ClientEnvEvent getClientEnvEvent();
|
||||
|
||||
/*!
|
||||
* Gets closest object pointed by the shootline.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue