Phantom Agent
Robadob opened this issue · 2 comments
Robadob commented
Robadob commented
Jack A has suggested this is to do with dead agents still being rendered, will investigate further soon.
Robadob commented
I think these two lines should actually be
if (!as.second.core_texture_buffers.empty() && as.second.dataSize && as.second.requiredSize) // Extra check to make sure buffer has been allocated successfully
as.second.entity->renderInstances(std::min(as.second.dataSize, as.second.requiredSize));
The code was accounting for if the buffer hadn't been allocated yet (or resized for an increased agent pop), but wasn't accounting for if the buffer was larger than the current required size (or if there were no agents).