forked from Mirrorlandia_minetest/minetest
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 = '.
This commit is contained in:
parent
65af7d2fb6
commit
8543df7752
@ -846,7 +846,7 @@ void ICraftAction::apply(InventoryManager *mgr,
|
|||||||
count_remaining--;
|
count_remaining--;
|
||||||
|
|
||||||
// Get next crafting result
|
// 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);
|
PLAYER_TO_SA(player)->item_CraftPredict(crafted, player, list_craft, craft_inv);
|
||||||
found = !crafted.empty();
|
found = !crafted.empty();
|
||||||
}
|
}
|
||||||
|
@ -64,7 +64,7 @@ struct DungeonParams {
|
|||||||
|
|
||||||
class DungeonGen {
|
class DungeonGen {
|
||||||
public:
|
public:
|
||||||
MMVManip *vm;
|
MMVManip *vm = nullptr;
|
||||||
const NodeDefManager *ndef;
|
const NodeDefManager *ndef;
|
||||||
GenerateNotifier *gennotify;
|
GenerateNotifier *gennotify;
|
||||||
|
|
||||||
|
@ -33,8 +33,6 @@ MapgenSinglenode::MapgenSinglenode(int mapgenid,
|
|||||||
MapgenParams *params, EmergeManager *emerge)
|
MapgenParams *params, EmergeManager *emerge)
|
||||||
: Mapgen(mapgenid, params, emerge)
|
: Mapgen(mapgenid, params, emerge)
|
||||||
{
|
{
|
||||||
flags = params->flags;
|
|
||||||
|
|
||||||
const NodeDefManager *ndef = emerge->ndef;
|
const NodeDefManager *ndef = emerge->ndef;
|
||||||
|
|
||||||
c_node = ndef->getId("mapgen_singlenode");
|
c_node = ndef->getId("mapgen_singlenode");
|
||||||
|
@ -35,7 +35,6 @@ struct MapgenSinglenodeParams : public MapgenParams
|
|||||||
class MapgenSinglenode : public Mapgen
|
class MapgenSinglenode : public Mapgen
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
u32 flags;
|
|
||||||
content_t c_node;
|
content_t c_node;
|
||||||
u8 set_light;
|
u8 set_light;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user