Allow texture modifiers in hotbar textures. (#9271)
authorWarr1024 <warr1024@gmail.com>
Wed, 26 Feb 2020 09:26:24 +0000 (04:26 -0500)
committerGitHub <noreply@github.com>
Wed, 26 Feb 2020 09:26:24 +0000 (10:26 +0100)
src/client/hud.cpp
src/network/clientpackethandler.cpp

index e78130dd42d0cf8a8712372d8add397761544ddf..37de6640bc978bbd4f3f2ec432cf58faa1f71fd5 100644 (file)
@@ -221,19 +221,13 @@ void Hud::drawItems(v2s32 upperleftpos, v2s32 screen_offset, s32 itemcount,
        // Store hotbar_image in member variable, used by drawItem()
        if (hotbar_image != player->hotbar_image) {
                hotbar_image = player->hotbar_image;
-               if (!hotbar_image.empty())
-                       use_hotbar_image = tsrc->isKnownSourceImage(hotbar_image);
-               else
-                       use_hotbar_image = false;
+               use_hotbar_image = !hotbar_image.empty();
        }
 
        // Store hotbar_selected_image in member variable, used by drawItem()
        if (hotbar_selected_image != player->hotbar_selected_image) {
                hotbar_selected_image = player->hotbar_selected_image;
-               if (!hotbar_selected_image.empty())
-                       use_hotbar_selected_image = tsrc->isKnownSourceImage(hotbar_selected_image);
-               else
-                       use_hotbar_selected_image = false;
+               use_hotbar_selected_image = !hotbar_selected_image.empty();
        }
 
        // draw customized item background
index ceb4b3b17e2f02cd4da71fae02d563236499772e..b887c02825a73a8b14e818ad1a510759e8d82552 100644 (file)
@@ -1224,21 +1224,9 @@ void Client::handleCommand_HudSetParam(NetworkPacket* pkt)
                        player->hud_hotbar_itemcount = hotbar_itemcount;
        }
        else if (param == HUD_PARAM_HOTBAR_IMAGE) {
-               // If value not empty verify image exists in texture source
-               if (!value.empty() && !getTextureSource()->isKnownSourceImage(value)) {
-                       errorstream << "Server sent wrong Hud hotbar image (sent value: '"
-                               << value << "')" << std::endl;
-                       return;
-               }
                player->hotbar_image = value;
        }
        else if (param == HUD_PARAM_HOTBAR_SELECTED_IMAGE) {
-               // If value not empty verify image exists in texture source
-               if (!value.empty() && !getTextureSource()->isKnownSourceImage(value)) {
-                       errorstream << "Server sent wrong Hud hotbar selected image (sent value: '"
-                                       << value << "')" << std::endl;
-                       return;
-               }
                player->hotbar_selected_image = value;
        }
 }