mirror of
https://github.com/pret/pokeplatinum.git
synced 2026-04-28 17:47:15 -05:00
underground: add price table size asserts (#990)
This commit is contained in:
parent
5156a26a83
commit
1e10ad9f65
|
|
@ -8,7 +8,6 @@
|
||||||
|
|
||||||
#include "underground/defs.h"
|
#include "underground/defs.h"
|
||||||
|
|
||||||
// TODO: make this error if it doesn't contain an entry for every trap
|
|
||||||
static const SpherePrice sTrapPrices[] = {
|
static const SpherePrice sTrapPrices[] = {
|
||||||
[TRAP_NONE] = { .sphereType = SPHERE_NONE, .minSize = 0, .maxSize = 0 },
|
[TRAP_NONE] = { .sphereType = SPHERE_NONE, .minSize = 0, .maxSize = 0 },
|
||||||
[TRAP_MOVE_UP] = { .sphereType = SPHERE_BLUE, .minSize = 3, .maxSize = 6 },
|
[TRAP_MOVE_UP] = { .sphereType = SPHERE_BLUE, .minSize = 3, .maxSize = 6 },
|
||||||
|
|
@ -45,6 +44,7 @@ static const SpherePrice sTrapPrices[] = {
|
||||||
[TRAP_RADAR_DUMMY] = { .sphereType = SPHERE_NONE, .minSize = 0, .maxSize = 0 },
|
[TRAP_RADAR_DUMMY] = { .sphereType = SPHERE_NONE, .minSize = 0, .maxSize = 0 },
|
||||||
[TRAP_DIGGER_DRILL] = { .sphereType = RANDOM_SPHERE_TYPE, .minSize = 15, .maxSize = 20 }
|
[TRAP_DIGGER_DRILL] = { .sphereType = RANDOM_SPHERE_TYPE, .minSize = 15, .maxSize = 20 }
|
||||||
};
|
};
|
||||||
|
SDK_COMPILER_ASSERT(NELEMS(sTrapPrices) == TRAP_MAX);
|
||||||
|
|
||||||
// params need to be const to match
|
// params need to be const to match
|
||||||
const u8 Trap_GetSpherePriceType(const enum Trap trapID)
|
const u8 Trap_GetSpherePriceType(const enum Trap trapID)
|
||||||
|
|
|
||||||
|
|
@ -8,7 +8,6 @@
|
||||||
#include "underground/defs.h"
|
#include "underground/defs.h"
|
||||||
#include "underground/mining.h"
|
#include "underground/mining.h"
|
||||||
|
|
||||||
// TODO: make this error if it doesn't contain an entry for every treasure
|
|
||||||
static const SpherePrice sTreasurePrices[] = {
|
static const SpherePrice sTreasurePrices[] = {
|
||||||
[MINING_TREASURE_NONE] = { .sphereType = SPHERE_NONE, .minSize = 0, .maxSize = 0 },
|
[MINING_TREASURE_NONE] = { .sphereType = SPHERE_NONE, .minSize = 0, .maxSize = 0 },
|
||||||
[MINING_SMALL_PRISM_SPHERE] = { .sphereType = SPHERE_NONE, .minSize = 0, .maxSize = 0 },
|
[MINING_SMALL_PRISM_SPHERE] = { .sphereType = SPHERE_NONE, .minSize = 0, .maxSize = 0 },
|
||||||
|
|
@ -71,6 +70,7 @@ static const SpherePrice sTreasurePrices[] = {
|
||||||
[MINING_TREASURE_DREAD_PLATE] = { .sphereType = SPHERE_RED, .minSize = 70, .maxSize = 80 },
|
[MINING_TREASURE_DREAD_PLATE] = { .sphereType = SPHERE_RED, .minSize = 70, .maxSize = 80 },
|
||||||
[MINING_TREASURE_IRON_PLATE] = { .sphereType = SPHERE_PRISM, .minSize = 70, .maxSize = 80 }
|
[MINING_TREASURE_IRON_PLATE] = { .sphereType = SPHERE_PRISM, .minSize = 70, .maxSize = 80 }
|
||||||
};
|
};
|
||||||
|
SDK_COMPILER_ASSERT(NELEMS(sTreasurePrices) == MINING_TREASURE_MAX);
|
||||||
|
|
||||||
u8 Treasure_GetSpherePriceType(int treasureID)
|
u8 Treasure_GetSpherePriceType(int treasureID)
|
||||||
{
|
{
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user