diff Actor.cpp @ 2153:d28d3c006077

Some Render decoupling.
author Nomad
date Thu, 09 Jan 2014 02:34:20 +0200
parents e99081a3a66a
children 9bd7522cdbbb
line wrap: on
line diff
--- a/Actor.cpp	Thu Jan 09 01:37:34 2014 +0200
+++ b/Actor.cpp	Thu Jan 09 02:34:20 2014 +0200
@@ -1,7 +1,3 @@
-#ifdef _MSC_VER
-#define _CRT_SECURE_NO_WARNINGS
-#endif
-
 #include "mm7_data.h"
 #include "DecalBuilder.h"
 
@@ -48,6 +44,33 @@
 std::array<uint, 5> dword_4DF380_hostilityRanges = {0,1024,2560,5120,10240};
 
 
+
+
+//----- (0042FB5C) --------------------------------------------------------
+// True if monster should play attack animation when casting this spell.
+bool ShouldMonsterPlayAttackAnim(signed int spell_id)
+{
+  switch (spell_id)
+  {
+    case SPELL_FIRE_HASTE:
+    case SPELL_AIR_SHIELD:
+    case SPELL_EARTH_STONESKIN:
+    case SPELL_SPIRIT_BLESS:
+    case SPELL_SPIRIT_FATE:
+    case SPELL_SPIRIT_HEROISM:
+    case SPELL_BODY_HAMMERHANDS:
+    case SPELL_BODY_POWER_CURE:
+    case SPELL_LIGHT_DISPEL_MAGIC:
+    case SPELL_LIGHT_DAY_OF_PROTECTION:
+    case SPELL_LIGHT_HOUR_OF_POWER:
+    case SPELL_DARK_PAIN_REFLECTION:
+      return false;
+  }
+
+  return true;
+}
+
+
 //----- (0041AF52) --------------------------------------------------------
 void Actor::DrawHealthBar(Actor *actor, GUIWindow *window)
 {
@@ -1584,7 +1607,7 @@
     v3->vVelocity.z = 0;
     v3->vVelocity.y = 0;
     v3->vVelocity.x = 0;
-    if ( _42FB5C_check_spell(v3->pMonsterInfo.uSpell2ID) )
+    if ( ShouldMonsterPlayAttackAnim(v3->pMonsterInfo.uSpell2ID) )
     {
       v3->uCurrentActionLength = 64;
       v3->uCurrentActionTime = 0;
@@ -1669,7 +1692,7 @@
     v3->vVelocity.z = 0;
     v3->vVelocity.y = 0;
     v3->vVelocity.x = 0;
-    if ( _42FB5C_check_spell(v3->pMonsterInfo.uSpell1ID) )
+    if ( ShouldMonsterPlayAttackAnim(v3->pMonsterInfo.uSpell1ID) )
     {
       v3->uCurrentActionLength = 64;
       v3->uCurrentActionTime = 0;