prevent over-buying cargo

This commit is contained in:
Tenari
2026-03-03 07:53:15 -06:00
parent 75c1579b1e
commit b8daf6cbc8
3 changed files with 23 additions and 8 deletions
+8
View File
@@ -324,6 +324,14 @@ typedef struct PlayerShip {
u32 commodities[Commodity_Count];
} PlayerShip;
fn u32 usedVacuumCargoSlots(PlayerShip ship) {
u32 used_cargo = 0;
for (u32 i = 0; i < Commodity_Count; i++) {
used_cargo += ship.commodities[i];
}
return used_cargo;
}
typedef enum PlanetType {
PlanetTypeNull,
PlanetTypeEarth,