2231 {
2233 string item_name;
2234 int attcount = this.GetInventory().AttachmentCount();
2235
2236 for (int att = 0; att < attcount; att++)
2237 {
2238 attachment = GetInventory().GetAttachmentFromIndex(att);
2239 if (attachment.IsItemBase())
2240 {
2241 item_name = attachment.GetType();
2242 if (
GetGame().IsKindOf(item_name, searched_item))
2243 {
2244 return attachment;
2245 }
2246 }
2247 }
2248 return NULL;
2249 }
proto native CGame GetGame()