mirror of https://github.com/minetest/minetest.git
A small change to enhance the effect.
This commit is contained in:
parent
7dc7dc848b
commit
6763f63936
|
@ -71,10 +71,11 @@ Camera::Camera(scene::ISceneManager* smgr, MapDrawControl& draw_control,
|
||||||
m_digging_anim(0),
|
m_digging_anim(0),
|
||||||
m_digging_button(-1),
|
m_digging_button(-1),
|
||||||
|
|
||||||
wielditem(55),
|
|
||||||
hand_anim_time(0),
|
hand_anim_time(0),
|
||||||
is_hand_anim(false),
|
is_hand_anim(false),
|
||||||
hand_anim_changed(false)
|
hand_anim_changed(false),
|
||||||
|
wieldslot(55),
|
||||||
|
wieldname("")
|
||||||
{
|
{
|
||||||
//dstream<<__FUNCTION_NAME<<std::endl;
|
//dstream<<__FUNCTION_NAME<<std::endl;
|
||||||
|
|
||||||
|
@ -565,8 +566,9 @@ void Camera::setDigging(s32 button)
|
||||||
|
|
||||||
void Camera::wield(const ItemStack &item, u16 player_select)
|
void Camera::wield(const ItemStack &item, u16 player_select)
|
||||||
{
|
{
|
||||||
if(player_select != wielditem) {
|
if(player_select != wieldslot || item.getDefinition(m_gamedef->idef()).name != wieldname) {
|
||||||
wielditem = player_select;
|
wieldslot = player_select;
|
||||||
|
wieldname = item.getDefinition(m_gamedef->idef()).name;
|
||||||
// Delay changing of the mesh for the anim
|
// Delay changing of the mesh for the anim
|
||||||
if(is_hand_anim && (hand_anim_time < 0.5)) {
|
if(is_hand_anim && (hand_anim_time < 0.5)) {
|
||||||
hand_anim_time = 0.1f;
|
hand_anim_time = 0.1f;
|
||||||
|
|
|
@ -176,13 +176,12 @@ private:
|
||||||
// If 1, right-click digging animation
|
// If 1, right-click digging animation
|
||||||
s32 m_digging_button;
|
s32 m_digging_button;
|
||||||
|
|
||||||
// Wield item
|
|
||||||
u16 wielditem;
|
|
||||||
|
|
||||||
// Camera Hand Anim
|
// Camera Hand Anim
|
||||||
f32 hand_anim_time;
|
f32 hand_anim_time;
|
||||||
bool is_hand_anim;
|
bool is_hand_anim;
|
||||||
bool hand_anim_changed;
|
bool hand_anim_changed;
|
||||||
|
u16 wieldslot;
|
||||||
|
std::string wieldname;
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
Loading…
Reference in New Issue