A small change to enhance the effect.

This commit is contained in:
Jonathon Anderson 2013-03-30 22:12:29 -05:00
parent 7dc7dc848b
commit 6763f63936
2 changed files with 8 additions and 7 deletions

View File

@ -71,10 +71,11 @@ Camera::Camera(scene::ISceneManager* smgr, MapDrawControl& draw_control,
m_digging_anim(0),
m_digging_button(-1),
wielditem(55),
hand_anim_time(0),
is_hand_anim(false),
hand_anim_changed(false)
hand_anim_changed(false),
wieldslot(55),
wieldname("")
{
//dstream<<__FUNCTION_NAME<<std::endl;
@ -565,8 +566,9 @@ void Camera::setDigging(s32 button)
void Camera::wield(const ItemStack &item, u16 player_select)
{
if(player_select != wielditem) {
wielditem = player_select;
if(player_select != wieldslot || item.getDefinition(m_gamedef->idef()).name != wieldname) {
wieldslot = player_select;
wieldname = item.getDefinition(m_gamedef->idef()).name;
// Delay changing of the mesh for the anim
if(is_hand_anim && (hand_anim_time < 0.5)) {
hand_anim_time = 0.1f;

View File

@ -176,13 +176,12 @@ private:
// If 1, right-click digging animation
s32 m_digging_button;
// Wield item
u16 wielditem;
// Camera Hand Anim
f32 hand_anim_time;
bool is_hand_anim;
bool hand_anim_changed;
u16 wieldslot;
std::string wieldname;
};
#endif