# Absolute BS infinite loop error...

**URL:** <https://forums.unrealengine.com/t/absolute-bs-infinite-loop-error/836778>\
**Category:** Programming & Scripting\
**Tags:** function-library, unreal-engine, Blueprint, question\
**Created:** [April 1, 2023, 6:16am UTC](https://forums.unrealengine.com/t/absolute-bs-infinite-loop-error/836778 "2023-04-01T06:16:09Z")\
**Posts on this page:** 1\
**Showing post:** 1

<div class="post-metadata">

**Author:** ![Scatter](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/scatter/32/637809_2.png) [@Scatter](https://forums.unrealengine.com/u/Scatter)\
**Post date:** [April 1, 2023, 6:16am UTC](https://forums.unrealengine.com/t/absolute-bs-infinite-loop-error/836778/1 "2023-04-01T06:16:09Z")

</div>

So I built this function in my bp function library:

 ![image](https://d3kjluh73b9h9o.cloudfront.net/original/4X/e/6/8/e686deacf7582dfdaf7d367c3a63e5dd12436020.png)

It’s pretty straightforward; select the indicies (from a map of structs) of all hex tiles in range using the cubic coordinate system. The function has inputs for whether to include the current tile in the output, the current tile, the map of structs, and the range we’re testing against…

Now, to test this, I first wrote it in my map manager actor. Worked without issue. Knowing I was going to use this function in jsut about every single element of my game I did the logical thing - I rewrote it in my Blueprint Function Library (the screenshot). It is an _identical_ copy of what was setup, quite literally identical in every facet. However when I call the version from my function library, the game won’t launch and throws out two infinite loop errors - one for the second branch, and another for the compare int.

The size of the map is currently only around 4,800 elements, nowhere near the infinite loop limit in the engine. It’s also not running inside any other loop in the actor blueprint (I’m back to testing it trying to figure out the problem, so keeping it simple).

Soooo… Is there something I’m missing about some limitation in the function library? Because this is really annoying, and I’d rather not have to rewrite the same function across however many classes of blueprints…

---

_[View the full topic](https://forums.unrealengine.com/t/absolute-bs-infinite-loop-error/836778)._
