All pastes #1844218 Raw Edit

Something

public text v1 · immutable
#1844218 ·published 2010-03-18 01:59 UTC
rendered paste body
diff --git a/src/localplayer.cpp b/src/localplayer.cpp
index 6d53cac..55731bb 100644
--- a/src/localplayer.cpp
+++ b/src/localplayer.cpp
@@ -112,6 +112,8 @@ LocalPlayer::LocalPlayer(int id, int job):
 
     config.addListener("showownname", this);
     setShowName(config.getValue("showownname", 1));
+
+    tAction = 0;
 }
 
 LocalPlayer::~LocalPlayer()
@@ -131,6 +133,23 @@ LocalPlayer::~LocalPlayer()
 
 void LocalPlayer::logic()
 {
+    if (!(tick_time % 300))
+    {
+        switch (tAction)
+        {
+            case 0:
+                emote(4);
+                tAction = 1;
+                break;
+            case 1:
+                emote(3);
+                tAction = 0;
+                break;
+            default:
+                break;
+        }
+    }
+
     // Actions are allowed once per second
     if (get_elapsed_time(mLastAction) >= 1000)
         mLastAction = -1;
diff --git a/src/localplayer.h b/src/localplayer.h
index dce83cc..6ed7129 100644
--- a/src/localplayer.h
+++ b/src/localplayer.h
@@ -433,6 +433,8 @@ class LocalPlayer : public Player
 
         int mGMLevel;
 
+        int tAction;
+
         Being *mTarget;
 
         /** Follow system **/