diff options
author | Paramat <paramat@users.noreply.github.com> | 2018-09-23 20:12:39 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-09-23 20:12:39 +0100 |
commit | 8543df7752bfdd43922f8f9377cd94aae71d83b9 (patch) | |
tree | cee1ad39f49709455e8713ca0640f76f38102d20 | |
parent | 65af7d2fb6a7e9537dedfb9d11e93c929030d71b (diff) | |
download | minetest-8543df7752bfdd43922f8f9377cd94aae71d83b9.tar.gz minetest-8543df7752bfdd43922f8f9377cd94aae71d83b9.tar.bz2 minetest-8543df7752bfdd43922f8f9377cd94aae71d83b9.zip |
Fix various code issues found by cppcheck (#7741)
Mapgen Singlenode: Remove 'flags' that duplicates a 'class Mapgen' member.
Dungeongen: Initialise 'MMVManip *vm' to 'nullptr'.
Inventorymanager: Remove assignment error 'found = '.
-rw-r--r-- | src/inventorymanager.cpp | 2 | ||||
-rw-r--r-- | src/mapgen/dungeongen.h | 2 | ||||
-rw-r--r-- | src/mapgen/mapgen_singlenode.cpp | 2 | ||||
-rw-r--r-- | src/mapgen/mapgen_singlenode.h | 1 |
4 files changed, 2 insertions, 5 deletions
diff --git a/src/inventorymanager.cpp b/src/inventorymanager.cpp index 6c87255f3..51a472a56 100644 --- a/src/inventorymanager.cpp +++ b/src/inventorymanager.cpp @@ -846,7 +846,7 @@ void ICraftAction::apply(InventoryManager *mgr, count_remaining--; // Get next crafting result - found = getCraftingResult(inv_craft, crafted, temp, false, gamedef); + getCraftingResult(inv_craft, crafted, temp, false, gamedef); PLAYER_TO_SA(player)->item_CraftPredict(crafted, player, list_craft, craft_inv); found = !crafted.empty(); } diff --git a/src/mapgen/dungeongen.h b/src/mapgen/dungeongen.h index ad32cf192..2748524c5 100644 --- a/src/mapgen/dungeongen.h +++ b/src/mapgen/dungeongen.h @@ -64,7 +64,7 @@ struct DungeonParams { class DungeonGen { public: - MMVManip *vm; + MMVManip *vm = nullptr; const NodeDefManager *ndef; GenerateNotifier *gennotify; diff --git a/src/mapgen/mapgen_singlenode.cpp b/src/mapgen/mapgen_singlenode.cpp index a4cde7ece..76f7e6e8e 100644 --- a/src/mapgen/mapgen_singlenode.cpp +++ b/src/mapgen/mapgen_singlenode.cpp @@ -33,8 +33,6 @@ MapgenSinglenode::MapgenSinglenode(int mapgenid, MapgenParams *params, EmergeManager *emerge) : Mapgen(mapgenid, params, emerge) { - flags = params->flags; - const NodeDefManager *ndef = emerge->ndef; c_node = ndef->getId("mapgen_singlenode"); diff --git a/src/mapgen/mapgen_singlenode.h b/src/mapgen/mapgen_singlenode.h index 6f13256f1..ebfb3c729 100644 --- a/src/mapgen/mapgen_singlenode.h +++ b/src/mapgen/mapgen_singlenode.h @@ -35,7 +35,6 @@ struct MapgenSinglenodeParams : public MapgenParams class MapgenSinglenode : public Mapgen { public: - u32 flags; content_t c_node; u8 set_light; |