1
0
Fork 0
mirror of https://github.com/luanti-org/luanti.git synced 2025-08-01 17:38:41 +00:00

Remove unused functions reported by cppcheck (#10463)

Run unused functions reported by cppcheck

This change removes a few (but not all) unused functions.
Some unused helper functions were not removed due to their complexity and potential of future use.
This commit is contained in:
SmallJoker 2020-10-05 09:07:33 +02:00 committed by GitHub
parent 81c66d6efb
commit f46509d5e2
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
29 changed files with 14 additions and 440 deletions

View file

@ -1665,11 +1665,6 @@ ClientEvent *Client::getClientEvent()
return event;
}
bool Client::connectedToServer()
{
return m_con->Connected();
}
const Address Client::getServerAddress()
{
return m_con->GetPeerAddress(PEER_ID_SERVER);

View file

@ -338,7 +338,6 @@ public:
u16 getProtoVersion()
{ return m_proto_ver; }
bool connectedToServer();
void confirmRegistration();
bool m_is_registration_confirmation_state = false;
bool m_simple_singleplayer_mode;

View file

@ -368,21 +368,6 @@ bool isFreeClientActiveObjectId(const u16 id,
}
u16 getFreeClientActiveObjectId(ClientActiveObjectMap &objects)
{
// try to reuse id's as late as possible
static u16 last_used_id = 0;
u16 startid = last_used_id;
for(;;) {
last_used_id ++;
if (isFreeClientActiveObjectId(last_used_id, objects))
return last_used_id;
if (last_used_id == startid)
return 0;
}
}
u16 ClientEnvironment::addActiveObject(ClientActiveObject *object)
{
// Register object. If failed return zero id

View file

@ -36,7 +36,7 @@ ClientMap::ClientMap(
MapDrawControl &control,
s32 id
):
Map(dout_client, client),
Map(client),
scene::ISceneNode(RenderingEngine::get_scene_manager()->getRootSceneNode(),
RenderingEngine::get_scene_manager(), id),
m_client(client),

View file

@ -81,33 +81,6 @@ void MeshMakeData::fill(MapBlock *block)
}
}
void MeshMakeData::fillSingleNode(MapNode *node)
{
m_blockpos = v3s16(0,0,0);
v3s16 blockpos_nodes = v3s16(0,0,0);
VoxelArea area(blockpos_nodes-v3s16(1,1,1)*MAP_BLOCKSIZE,
blockpos_nodes+v3s16(1,1,1)*MAP_BLOCKSIZE*2-v3s16(1,1,1));
s32 volume = area.getVolume();
s32 our_node_index = area.index(1,1,1);
// Allocate this block + neighbors
m_vmanip.clear();
m_vmanip.addArea(area);
// Fill in data
MapNode *data = new MapNode[volume];
for(s32 i = 0; i < volume; i++)
{
if (i == our_node_index)
data[i] = *node;
else
data[i] = MapNode(CONTENT_AIR, LIGHT_MAX, 0);
}
m_vmanip.copyFrom(data, area, area.MinEdge, area.MinEdge, area.getExtent());
delete[] data;
}
void MeshMakeData::setCrack(int crack_level, v3s16 crack_pos)
{
if (crack_level >= 0)

View file

@ -62,11 +62,6 @@ struct MeshMakeData
*/
void fill(MapBlock *block);
/*
Set up with only a single node at (1,1,1)
*/
void fillSingleNode(MapNode *node);
/*
Set the (node) position of a crack
*/