From 1b3381ce8e4dd8b838c5aacdaf2cbe4bc9bd92b1 Mon Sep 17 00:00:00 2001 From: obligaron Date: Sat, 11 Sep 2021 08:48:45 +0200 Subject: [PATCH] Move CrawlNum to CrawlTable and make it extern visible --- Source/lighting.cpp | 2 ++ Source/lighting.h | 1 + Source/missiles.cpp | 2 -- test/lighting_test.cpp | 2 -- 4 files changed, 3 insertions(+), 4 deletions(-) diff --git a/Source/lighting.cpp b/Source/lighting.cpp index 221b2a8a2..c43b97dca 100644 --- a/Source/lighting.cpp +++ b/Source/lighting.cpp @@ -414,6 +414,8 @@ const int8_t CrawlTable[2749] = { // clang-format on }; +const int CrawlNum[19] = { 0, 3, 12, 45, 94, 159, 240, 337, 450, 579, 724, 885, 1062, 1255, 1464, 1689, 1930, 2187, 2460 }; + /* * X- Y-coordinate offsets of lighting visions. * The last entry-pair is only for alignment. diff --git a/Source/lighting.h b/Source/lighting.h index cc859752a..827987eab 100644 --- a/Source/lighting.h +++ b/Source/lighting.h @@ -74,6 +74,7 @@ void lighting_color_cycling(); /* rdata */ extern const int8_t CrawlTable[2749]; +extern const int CrawlNum[19]; extern const uint8_t VisionCrawlTable[23][30]; } // namespace devilution diff --git a/Source/missiles.cpp b/Source/missiles.cpp index 4dcdd90f3..db84fc282 100644 --- a/Source/missiles.cpp +++ b/Source/missiles.cpp @@ -36,8 +36,6 @@ namespace { ChainStruct chain[MAXMISSILES]; int numchains; -const int CrawlNum[19] = { 0, 3, 12, 45, 94, 159, 240, 337, 450, 579, 724, 885, 1062, 1255, 1464, 1689, 1930, 2187, 2460 }; - int AddClassHealingBonus(int hp, HeroClass heroClass) { switch (heroClass) { diff --git a/test/lighting_test.cpp b/test/lighting_test.cpp index 38aef6266..ed412bf50 100644 --- a/test/lighting_test.cpp +++ b/test/lighting_test.cpp @@ -7,8 +7,6 @@ using namespace devilution; TEST(Lighting, CrawlTables) { - int CrawlNum[19] = { 0, 3, 12, 45, 94, 159, 240, 337, 450, 579, 724, 885, 1062, 1255, 1464, 1689, 1930, 2187, 2460 }; - bool added[40][40]; memset(added, 0, sizeof(added));