Some fixes of the merge conflicts

This commit is contained in:
Andrey2470T 2024-03-01 22:56:26 +03:00
parent a71d47edb6
commit 147e481b2b
4 changed files with 6 additions and 47 deletions

@ -373,13 +373,6 @@ void Camera::notifyFovChange()
}
}
// Returns the fractional part of x
inline f32 my_modf(f32 x)
{
float dummy;
return std::modf(x, &dummy);
}
void Camera::step(f32 dtime)
{
for (auto node : m_wieldnodes)
@ -392,14 +385,6 @@ void Camera::step(f32 dtime)
m_view_bobbing_fall = -1; // Mark the effect as finished
}
bool was_under_zero = m_wield_change_timer < 0;
m_wield_change_timer = MYMIN(m_wield_change_timer + dtime, 0.125);
if (m_wield_change_timer >= 0 && was_under_zero) {
m_wieldnode->setItem(m_wield_item_next, m_client);
m_wieldnode->setNodeLightColor(m_player_light_color);
}
if (m_view_bobbing_state != 0)
{
//f32 offset = dtime * m_view_bobbing_speed * 0.035;
@ -437,26 +422,6 @@ void Camera::step(f32 dtime)
}
}
}
if (m_digging_button != -1) {
f32 offset = dtime * 3.5f;
float m_digging_anim_was = m_digging_anim;
m_digging_anim += offset;
if (m_digging_anim >= 1)
{
m_digging_anim = 0;
m_digging_button = -1;
}
float lim = 0.15;
if(m_digging_anim_was < lim && m_digging_anim >= lim)
{
if (m_digging_button == 0) {
m_client->getEventManager()->put(new SimpleTriggerEvent(MtEvent::CAMERA_PUNCH_LEFT));
} else if(m_digging_button == 1) {
m_client->getEventManager()->put(new SimpleTriggerEvent(MtEvent::CAMERA_PUNCH_RIGHT));
}
}
}
}
void Camera::addArmInertia(f32 player_yaw)

@ -4231,14 +4231,6 @@ void Game::updateFrame(ProfilerGraph *graph, RunStats *stats, f32 dtime,
runData.damage_flash -= 384.0f * dtime;
}
/*
==================== End scene ====================
*/
driver->endScene();
stats->drawtime = tt_draw.stop(true);
g_profiler->graphAdd("Draw scene [us]", stats->drawtime);
g_profiler->avg("Game::updateFrame(): update frame [ms]", tt_update.stop(true));
}

@ -919,8 +919,8 @@ static inline void getWieldedItem(const PlayerSAO *playersao, std::optional<Item
playersao->getWieldedItem(&(*ret));
}
static inline bool getOffhandWieldedItem(const PlayerSAO *playersao, Optional<ItemStack> &offhand,
Optional<ItemStack> &place, IItemDefManager *idef, const PointedThing &pointed)
static inline bool getOffhandWieldedItem(const PlayerSAO *playersao, std::optional<ItemStack> &offhand,
std::optional<ItemStack> &place, IItemDefManager *idef, const PointedThing &pointed)
{
offhand = ItemStack();
place = ItemStack();
@ -1263,7 +1263,7 @@ void Server::handleCommand_Interact(NetworkPacket *pkt)
if (use_offhand
? (offhand_item.has_value() && playersao->setOffhandWieldedItem(*offhand_item))
: (main_item.has_value() && playersao->setWieldedItem(*main_item)))
SendInventory(playersao, true);
SendInventory(player, true);
}
pointed_object->rightClick(playersao);
@ -1274,7 +1274,7 @@ void Server::handleCommand_Interact(NetworkPacket *pkt)
if (use_offhand
? (offhand_item.has_value() && playersao->setOffhandWieldedItem(*offhand_item))
: (main_item.has_value() && playersao->setWieldedItem(*main_item)))
SendInventory(playersao, true);
SendInventory(player, true);
}
if (pointed.type != POINTEDTHING_NODE)

@ -27,6 +27,8 @@ with this program; if not, write to the Free Software Foundation, Inc.,
#include "util/numeric.h"
#include "util/pointedthing.h"
class IItemDefManager;
/*
PlayerSAO needs some internals exposed.
*/