# HG changeset patch # User Grumpy7 # Date 1382587811 25200 # Node ID 28b8ecb5dac6ced2ea67e312bedae9da45c6638f # Parent 2e3d08ff33097a7f2fb793c087348218e33281e1 Fixing bug in Actor::AI_RangedAttack introduced by me diff -r 2e3d08ff3309 -r 28b8ecb5dac6 Actor.cpp --- 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;