Skip to content

Commit

Permalink
Fix various code issues found by cppcheck (#7741)
Browse files Browse the repository at this point in the history
Mapgen Singlenode: Remove 'flags' that duplicates a 'class Mapgen' member.
Dungeongen: Initialise 'MMVManip *vm' to 'nullptr'.
Inventorymanager: Remove assignment error 'found = '.
  • Loading branch information
paramat committed Sep 23, 2018
1 parent 65af7d2 commit 8543df7
Show file tree
Hide file tree
Showing 4 changed files with 2 additions and 5 deletions.
2 changes: 1 addition & 1 deletion src/inventorymanager.cpp
Expand Up @@ -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();
}
Expand Down
2 changes: 1 addition & 1 deletion src/mapgen/dungeongen.h
Expand Up @@ -64,7 +64,7 @@ struct DungeonParams {

class DungeonGen {
public:
MMVManip *vm;
MMVManip *vm = nullptr;
const NodeDefManager *ndef;
GenerateNotifier *gennotify;

Expand Down
2 changes: 0 additions & 2 deletions src/mapgen/mapgen_singlenode.cpp
Expand Up @@ -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");
Expand Down
1 change: 0 additions & 1 deletion src/mapgen/mapgen_singlenode.h
Expand Up @@ -35,7 +35,6 @@ struct MapgenSinglenodeParams : public MapgenParams
class MapgenSinglenode : public Mapgen
{
public:
u32 flags;
content_t c_node;
u8 set_light;

Expand Down

0 comments on commit 8543df7

Please sign in to comment.