Skip to content

Commit

Permalink
Fix warnings about dungeongen.cpp memcpy() and unused variable in Map…
Browse files Browse the repository at this point in the history
…Block::deSerializeNetworkSpecific() (#8122)

* Fix warning about dungeongen.cpp memcpy()

* Fix unused variable in MapBlock::deSerializeNetworkSpecific()

* Fix unused variable a simpler way
  • Loading branch information
paramat authored and nerzhul committed Jan 22, 2019
1 parent 33afe1f commit bc1e547
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
7 changes: 4 additions & 3 deletions src/mapblock.cpp
Expand Up @@ -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"
Expand Down
2 changes: 1 addition & 1 deletion src/mapgen/dungeongen.cpp
Expand Up @@ -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;
Expand Down

0 comments on commit bc1e547

Please sign in to comment.