09-21-2013, 11:10 PM
Привет!
I am rewriting the redstone simulator because the current one doesn't work.
However, I am encountering a difficulty (namely, an assert fired by deque) trying to get blocks to be powered or changed as a result of being powered. This only happens in DEBUG and not release.
The assert fired tells me: Expression: deque iterator not incrementable
What is the cause of this?
This code, for example, breaks:
I am rewriting the redstone simulator because the current one doesn't work.
However, I am encountering a difficulty (namely, an assert fired by deque) trying to get blocks to be powered or changed as a result of being powered. This only happens in DEBUG and not release.
The assert fired tells me: Expression: deque iterator not incrementable
What is the cause of this?
This code, for example, breaks:
void cRedstoneSimulator::HandleTNT(const Vector3i & a_BlockPos) { if (AreCoordsPowered(a_BlockPos)) { m_World.BroadcastSoundEffect("random.fuse", a_BlockPos.x * 8, a_BlockPos.y * 8, a_BlockPos.z * 8, 0.5f, 0.6f); m_World.SpawnPrimedTNT(a_BlockPos.x + 0.5, a_BlockPos.y + 0.5, a_BlockPos.z + 0.5, 4); // 4 seconds to boom m_World.SetBlock(a_BlockPos.x, a_BlockPos.y, a_BlockPos.z, E_BLOCK_AIR, 0); } return; }
bool cRedstoneSimulator::AreCoordsPowered(const Vector3i & a_BlockPos) { for (PoweredBlocksList::iterator itr = m_PoweredBlocks.begin(); itr != m_PoweredBlocks.end(); ++itr) { sPoweredBlocks & Change = *itr; if (Change.a_BlockPos.Equals(a_BlockPos)) { return true; } } return false; }