changeset 1932:28b8ecb5dac6

Fixing bug in Actor::AI_RangedAttack introduced by me
author Grumpy7
date Wed, 23 Oct 2013 21:10:11 -0700
parents 2e3d08ff3309
children 5fcf6023f9c3
files Actor.cpp
diffstat 1 files changed, 15 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/Actor.cpp	Wed Oct 23 20:36:19 2013 -0700
+++ b/Actor.cpp	Wed Oct 23 21:10:11 2013 -0700
@@ -848,7 +848,21 @@
     default:
       return;
   }
-  a1.uObjectDescID = GetObjDescId(a1.uType);
+  bool found = false;
+  for ( uint i = 0; i < pObjectList->uNumObjects; i++)
+  {
+    if (pObjectList->pObjects[i].uObjectID == a1.uType)
+    {
+      a1.uObjectDescID = i;
+      found = true;
+      break;
+    }
+  }
+  if (!found)
+  {
+    Error("Item not found");
+    return;
+  }
   a1.stru_24.Reset();
   a1.vPosition.x = actPtr->vPosition.x;
   a1.spell_id = 0;