Skip to content

Commit

Permalink
Small Spaceship biome fixes in the editor.
Browse files Browse the repository at this point in the history
GitOrigin-RevId: c8fc59a1238b3d6726e9030d0797da5d43f7104b
  • Loading branch information
cpojer committed Aug 6, 2024
1 parent 85da871 commit b3a12a1
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 6 deletions.
1 change: 0 additions & 1 deletion athena/info/Building.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -554,7 +554,6 @@ export const Medbay = new BuildingInfo(
{
behaviors: new BuildingBehaviors({ heal: true }),
canBeCreated: false,
cost: Number.POSITIVE_INFINITY,
defense: 50,
editorPlaceOn: new Set([Plain]),
healTypes: new Set([EntityType.Infantry, EntityType.AirInfantry]),
Expand Down
15 changes: 10 additions & 5 deletions hera/editor/panels/DesignPanel.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import {
getAllTiles,
getTileInfo,
Plain,
Teleporter,
TileInfo,
} from '@deities/athena/info/Tile.tsx';
import {
Expand All @@ -15,6 +16,7 @@ import {
import getBiomeBuildingRestrictions from '@deities/athena/lib/getBiomeBuildingRestrictions.tsx';
import getBiomeStyle from '@deities/athena/lib/getBiomeStyle.tsx';
import getBiomeUnitRestrictions from '@deities/athena/lib/getBiomeUnitRestrictions.tsx';
import { Biome } from '@deities/athena/map/Biome.tsx';
import Building from '@deities/athena/map/Building.tsx';
import {
AnimationConfig,
Expand Down Expand Up @@ -82,11 +84,14 @@ export default function DesignPanel({
const biomeBuildingRestrictions = getBiomeBuildingRestrictions(biome);
const biomeUnitRestrictions = getBiomeUnitRestrictions(biome);
const { alert } = useAlert();
const tiles = useMemo(
() =>
getAllTiles().filter((tile) => !biomeStyle.tileRestrictions?.has(tile)),
[biomeStyle.tileRestrictions],
);
const tiles = useMemo(() => {
const tiles = getAllTiles().filter(
(tile) => !biomeStyle.tileRestrictions?.has(tile),
);
return biome === Biome.Spaceship && hasContentRestrictions
? tiles.filter((tile) => tile !== Teleporter)
: tiles;
}, [biome, biomeStyle.tileRestrictions, hasContentRestrictions]);
const skills = useMemo(() => new Set(user.skills), [user.skills]);
const buildings = useMemo(
() =>
Expand Down

0 comments on commit b3a12a1

Please sign in to comment.