2222 {
2224 string item_name;
2225 int attcount = this.GetInventory().AttachmentCount();
2226
2227 for (int att = 0; att < attcount; att++)
2228 {
2229 attachment = GetInventory().GetAttachmentFromIndex(att);
2230 if (attachment.IsItemBase())
2231 {
2232 item_name = attachment.GetType();
2233 if (
GetGame().IsKindOf(item_name, searched_item))
2234 {
2235 return attachment;
2236 }
2237 }
2238 }
2239 return NULL;
2240 }
proto native CGame GetGame()