mirror of
https://github.com/luanti-org/luanti.git
synced 2025-10-13 16:45:20 +02: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:
@@ -3055,11 +3055,10 @@ inline void Game::step(f32 *dtime)
|
||||
|
||||
void Game::processClientEvents(CameraOrientation *cam)
|
||||
{
|
||||
ClientEvent event = client->getClientEvent();
|
||||
|
||||
LocalPlayer *player = client->getEnv().getLocalPlayer();
|
||||
|
||||
for ( ; event.type != CE_NONE; event = client->getClientEvent()) {
|
||||
while (client->hasClientEvents()) {
|
||||
ClientEvent event = client->getClientEvent();
|
||||
|
||||
switch (event.type) {
|
||||
case CE_PLAYER_DAMAGE:
|
||||
|
Reference in New Issue
Block a user