aboutsummaryrefslogtreecommitdiff
path: root/src/camera.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/camera.cpp')
-rw-r--r--src/camera.cpp14
1 files changed, 12 insertions, 2 deletions
diff --git a/src/camera.cpp b/src/camera.cpp
index fada47608..0148298cb 100644
--- a/src/camera.cpp
+++ b/src/camera.cpp
@@ -188,13 +188,23 @@ void Camera::step(f32 dtime)
if (m_digging_button != -1)
{
f32 offset = dtime * 3.5;
+ 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;
- MtEvent *e = new SimpleTriggerEvent("CameraDig");
- m_gamedef->event()->put(e);
+ }
+ float lim = 0.15;
+ if(m_digging_anim_was < lim && m_digging_anim >= lim)
+ {
+ if(m_digging_button == 0){
+ MtEvent *e = new SimpleTriggerEvent("CameraPunchLeft");
+ m_gamedef->event()->put(e);
+ } else if(m_digging_button == 1){
+ MtEvent *e = new SimpleTriggerEvent("CameraPunchRight");
+ m_gamedef->event()->put(e);
+ }
}
}
}