Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[no squash] Minor bugfixes #13830

Merged
merged 3 commits into from
Sep 24, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/client/game.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -972,7 +972,7 @@ class Game {

bool m_first_loop_after_window_activation = false;
bool m_camera_offset_changed = false;
bool m_game_focused;
bool m_game_focused = false;

bool m_does_lost_focus_pause_game = false;

Expand Down Expand Up @@ -1951,7 +1951,7 @@ void Game::processUserInput(f32 dtime)
{
// Reset input if window not active or some menu is active
if (!device->isWindowActive() || isMenuActive() || guienv->hasFocus(gui_chat_console)) {
if(m_game_focused) {
if (m_game_focused) {
m_game_focused = false;
infostream << "Game lost focus" << std::endl;
input->releaseAllKeys();
Expand Down
2 changes: 2 additions & 0 deletions src/client/mesh.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -337,6 +337,8 @@ bool checkMeshNormals(scene::IMesh *mesh)

for (u32 i = 0; i < buffer_count; i++) {
scene::IMeshBuffer *buffer = mesh->getMeshBuffer(i);
if (!buffer->getVertexCount())
sfan5 marked this conversation as resolved.
Show resolved Hide resolved
continue;

// Here we intentionally check only first normal, assuming that if buffer
// has it valid, then most likely all other ones are fine too. We can
Expand Down
6 changes: 4 additions & 2 deletions src/network/networkpacket.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,8 @@ void NetworkPacket::putRawPacket(const u8 *data, u32 datasize, session_t peer_id

// split command and datas
m_command = readU16(&data[0]);
memcpy(m_data.data(), &data[2], m_datasize);
if (m_datasize > 0)
memcpy(m_data.data(), &data[2], m_datasize);
}

void NetworkPacket::clear()
Expand Down Expand Up @@ -553,7 +554,8 @@ Buffer<u8> NetworkPacket::oldForgePacket()
{
Buffer<u8> sb(m_datasize + 2);
writeU16(&sb[0], m_command);
memcpy(&sb[2], m_data.data(), m_datasize);
if (m_datasize > 0)
memcpy(&sb[2], m_data.data(), m_datasize);

return sb;
}