Skip to content

Instantly share code, notes, and snippets.

@Rseding91
Created November 22, 2024 13:01
Show Gist options
  • Save Rseding91/82adb034ce4f27692ef5d9f5887bbf09 to your computer and use it in GitHub Desktop.
Save Rseding91/82adb034ce4f27692ef5d9f5887bbf09 to your computer and use it in GitHub Desktop.
TEST(SpiderSetupPositionDoesNotGenerateChunks)
{
TestScenario scenario;
const size_t chunksTotalBefore = scenario.getMap().chunksTotal;
ScopedSetter guard(CorePrototypes::defaultTile, TileID("out-of-map").getPrototype());
for (bool simulation : { true, false })
{
auto spider = scenario.constructEntity("spidertron", MapPosition(5000, 5000), IsSimulation::fromBool(simulation));
{
spider->setupPosition(scenario.getDefaultSurface());
spider->setupBoundingBox();
EntityGhostBuildabilityHelper helper(spider.get());
}
CHECK_EQUAL(scenario.getMap().chunksTotal, chunksTotalBefore);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment