Fix warnings about dungeongen.cpp memcpy() and unused variable in MapBlock::deSeriali...
authorParamat <paramat@users.noreply.github.com>
Tue, 22 Jan 2019 21:13:06 +0000 (21:13 +0000)
committerLoïc Blot <nerzhul@users.noreply.github.com>
Tue, 22 Jan 2019 21:13:06 +0000 (22:13 +0100)
* Fix warning about dungeongen.cpp memcpy()

* Fix unused variable in MapBlock::deSerializeNetworkSpecific()

* Fix unused variable a simpler way

src/mapblock.cpp
src/mapgen/dungeongen.cpp

index 734ea478d919634d3789271ccc7af75130969140..0996dd168874dea543cc2e7c5e0cd5654b8b0e86 100644 (file)
@@ -557,9 +557,10 @@ void MapBlock::deSerialize(std::istream &is, u8 version, bool disk)
 void MapBlock::deSerializeNetworkSpecific(std::istream &is)
 {
        try {
-               const u8 version = readU8(is);
-               //if(version != 1)
-               //      throw SerializationError("unsupported MapBlock version");
+               readU8(is);
+               //const u8 version = readU8(is);
+               //if (version != 1)
+                       //throw SerializationError("unsupported MapBlock version");
 
        } catch(SerializationError &e) {
                warningstream<<"MapBlock::deSerializeNetworkSpecific(): Ignoring an error"
index 32bea4caa4aadf5e35d60c284f158b788ea6889a..77ac05770769d3fd10ffc0a0c3dcc5ce4674260e 100644 (file)
@@ -51,7 +51,7 @@ DungeonGen::DungeonGen(const NodeDefManager *ndef,
 #endif
 
        if (dparams) {
-               memcpy(&dp, dparams, sizeof(dp));
+               dp = *dparams;
        } else {
                // Default dungeon parameters
                dp.seed = 0;