diff Player.cpp @ 1352:88f80476c99c

Player::PlayEmotion simplified main condition, renamed a few expression enum vals
author Grumpy7
date Sat, 13 Jul 2013 11:56:57 +0200
parents f1209ed77782
children 8f69f77a0067
line wrap: on
line diff
--- a/Player.cpp	Sat Jul 13 04:16:30 2013 +0200
+++ b/Player.cpp	Sat Jul 13 11:56:57 2013 +0200
@@ -587,9 +587,8 @@
       if ( pSoundList->pSounds[v17].pSoundData[0] )
         expressionDuration = (sLastTrackLengthMS << 7) / 1000;
     }
-    /*LOWORD(v14) = */PlayEmotion(expression, expressionDuration);
-  }
-  //return v14;
+    PlayEmotion(expression, expressionDuration);
+  }
 }
 // 4948B1: using guessed type int var_1C[5];
 
@@ -604,30 +603,25 @@
 
   //LOWORD(v3) = this->expression;
   //v4 = expr;
-  if (expression != CHARACTER_EXPRESSION_SLEEP &&
-      expression != CHARACTER_EXPRESSION_PERTIFIED || new_expression != CHARACTER_EXPRESSION_58)
-  {
-    int v3 = (unsigned)expression;
-    if ( (signed int)(unsigned __int16)v3 >= 2 )
-    {
-      if ( v3 <= 7 )
-        goto LABEL_12;
-      if ( v3 > 8 )
-      {
-        if ( v3 > 11 )
-        {
-          if ( v3 == CHARACTER_EXPRESSION_PERTIFIED ||( v3 > 97 && v3 <= 99) )
-            return;
-          goto LABEL_15;
-        }
-LABEL_12:
-        if (new_expression != CHARACTER_EXPRESSION_34 && new_expression != CHARACTER_EXPRESSION_35 && new_expression != CHARACTER_EXPRESSION_36)
-          return;
-        goto LABEL_15;
-      }
-    }
-  }
-LABEL_15:
+  unsigned int v3 = expression;
+  if (expression == CHARACTER_EXPRESSION_DEAD || expression == CHARACTER_EXPRESSION_ERADICATED)
+  {
+    return;
+  }
+  else if (expression == CHARACTER_EXPRESSION_PERTIFIED && new_expression != CHARACTER_EXPRESSION_FALLING)
+  {
+    return;
+  }
+  else 
+  {
+    if (expression != CHARACTER_EXPRESSION_SLEEP || new_expression != CHARACTER_EXPRESSION_FALLING)
+    {
+      if (v3 >= 2 && v3 <= 11 && v3 != 8 && !(new_expression == CHARACTER_EXPRESSION_DMGRECVD_MINOR || new_expression == CHARACTER_EXPRESSION_DMGRECVD_MODERATE || new_expression == CHARACTER_EXPRESSION_DMGRECVD_MAJOR))
+      {
+        return;
+      }
+    }
+  }
   //LOWORD(v3) = a3;
   v5 = 0;
   this->uExpressionTimeLength = a3;