clang-tidy: fix many warnings

This commit is contained in:
Er2
2023-12-02 21:04:21 +03:00
parent 0f9131c43a
commit bf78dd4bf1
28 changed files with 61 additions and 57 deletions

View File

@@ -49,7 +49,7 @@ void Entity::_init()
field_B8 = 0;
field_BC = 300;
field_C0 = 0;
field_C8 = 0; // @NOTE: Render type? (eEntityRenderType)
m_renderType = RENDER_NONE;
m_distanceFallen = 0.0f;
field_D0 = 300;
field_D4 = 0;
@@ -64,7 +64,7 @@ Entity::Entity(Level* pLevel)
m_pLevel = pLevel;
m_EntityID = ++entityCounter;
setPos(0, 0, 0);
Entity::setPos(0, 0, 0);
}
Entity::~Entity()

View File

@@ -203,7 +203,7 @@ public:
int field_BC;
int field_C0;
int field_C4;
int field_C8; // @NOTE: Render type? (eEntityRenderType)
int m_renderType;
float m_distanceFallen;
int field_D0;
uint8_t field_D4;

View File

@@ -30,7 +30,7 @@ FallingTile::FallingTile(Level* level, float x, float y, float z, int id) : Enti
m_vel.z = 0.0f;
#if defined(ENH_ALLOW_SAND_GRAVITY)
field_C8 = RENDER_FALLING_TILE;
m_renderType = RENDER_FALLING_TILE;
#endif
}

View File

@@ -28,7 +28,7 @@ void ItemEntity::_init(ItemInstance* itemInstance, float x, float y, float z)
{
_init(itemInstance);
field_C8 = RENDER_ITEM;
m_renderType = RENDER_ITEM;
setPos(x, y, z);
m_yaw = 360.0f * Mth::random();
@@ -149,6 +149,7 @@ void ItemEntity::checkInTile(float x, float y, float z)
if (!solidYP && 1.0f - ydiff < mindist) mindist = 1.0f - ydiff, mindir = 3;
if (!solidZN && zdiff < mindist) mindist = zdiff, mindir = 4;
if (!solidZP && 1.0f - zdiff < mindist) mindist = 1.0f - zdiff, mindir = 5;
(void)mindist;
// the -1 case will be handled accordingly
float force = 0.1f + 0.2f * sharedRandom.nextFloat();

View File

@@ -22,7 +22,7 @@ Player::Player(Level* pLevel) : Mob(pLevel)
field_BC4 = 0;
m_bHaveRespawnPos = false;
field_C8 = 2;
m_renderType = RENDER_HUMANOID;
m_pInventory = new Inventory(this);

View File

@@ -12,7 +12,7 @@
void PrimedTnt::_init()
{
m_fuseTimer = 0;
field_C8 = RENDER_TNT;
m_renderType = RENDER_TNT;
field_34 = 1;
setSize(0.98f, 0.98f);
field_84 = field_8C * 0.5f;

View File

@@ -12,12 +12,11 @@
TripodCamera::TripodCamera(Level* level, Player* player, float x, float y, float z) : Mob(level)
{
field_B8C = 0;
field_B90 = 80;
m_iTimer = 80;
m_bActive = false;
m_owner = player;
field_C8 = RENDER_CAMERA;
m_renderType = RENDER_CAMERA;
field_60 = m_pitch = player->m_pitch;
field_5C = m_yaw = player->m_yaw;
@@ -83,14 +82,14 @@ void TripodCamera::tick()
if (!m_bActive)
return;
field_B90--;
if (field_B90 == 0)
m_iTimer--;
if (m_iTimer == 0)
{
remove();
return;
}
if (field_B90 == 8)
if (m_iTimer == 8)
{
m_pLevel->takePicture(this, m_owner);
m_pLevel->addParticle("explode", m_pos.x, m_pos.y + 0.6f, m_pos.z, 0.0f, 0.0f, 0.0f);
@@ -99,7 +98,7 @@ void TripodCamera::tick()
return;
}
if (field_B90 > 8)
if (m_iTimer > 8)
{
m_pLevel->addParticle("smoke", m_pos.x, m_pos.y + 1.0f, m_pos.z, 0.0f, 0.0f, 0.0f);
}

View File

@@ -27,8 +27,7 @@ public:
void tick() override;
public:
int field_B8C;
int field_B90;
int m_iTimer;
Player* m_owner;
bool m_bActive;
};