Modernize client code (#6250)
[oweals/minetest.git] / src / wieldmesh.cpp
index e0d6b7e0dc70e104b969aab7e901bef1c43cbf27..c532a048c0d0327ce737561808e725af1dafdcf1 100644 (file)
@@ -593,7 +593,7 @@ void postProcessNodeMesh(scene::SMesh *mesh, const ContentFeatures &f,
                                material.MaterialType = *mattype;
                        }
                        if (layer->animation_frame_count > 1) {
-                               FrameSpec animation_frame = layer->frames[0];
+                               const FrameSpec &animation_frame = (*layer->frames)[0];
                                material.setTexture(0, animation_frame.texture);
                        } else {
                                material.setTexture(0, layer->texture);
@@ -601,7 +601,7 @@ void postProcessNodeMesh(scene::SMesh *mesh, const ContentFeatures &f,
                        if (use_shaders) {
                                if (layer->normal_texture) {
                                        if (layer->animation_frame_count > 1) {
-                                               FrameSpec animation_frame = layer->frames[0];
+                                               const FrameSpec &animation_frame = (*layer->frames)[0];
                                                material.setTexture(1, animation_frame.normal_texture);
                                        } else
                                                material.setTexture(1, layer->normal_texture);