Skip to content

Commit

Permalink
fix: Don't overfill any rooms with cargo.
Browse files Browse the repository at this point in the history
  • Loading branch information
alexanderson1993 committed Jan 16, 2023
1 parent f65f703 commit d1062c7
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 5 deletions.
2 changes: 1 addition & 1 deletion client/src/components/QuoteOfTheDay.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -247,7 +247,7 @@ const quotes = [
const QuoteOfTheDay = () => {
const quote = useRef(quotes[Math.floor(Math.random() * quotes.length)]);
return (
<h5 className="text-lg px-2 fixed bottom-0 right-0 text-white text-opacity-60">
<h5 className="text-lg px-2 fixed bottom-0 right-0 text-white text-opacity-60 max-w-prose">
{quote.current}
</h5>
);
Expand Down
6 changes: 3 additions & 3 deletions server/src/components/shipMap/passengerMovement.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@ export class PassengerMovementComponent extends Component {
y: MetersPerSecond;
z: MetersPerSecond;
} = {
x: 1.3,
y: 1.3,
z: 1.3 / 10, // The Z default is because decks are 10 meters high, so it should take 10x as long to move between decks.
x: 3,
y: 3,
z: 3 / 10, // The Z default is because decks are 10 meters high, so it should take 10x as long to move between decks.
};
}
3 changes: 2 additions & 1 deletion server/src/spawners/inventory.ts
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@ export function generateShipInventory(
roomEntity.contents[inventoryTemplate.name] ?? 0;
roomEntity.contents[inventoryTemplate.name] += 1;
totalVolume -= inventoryTemplate.volume;
room.availableVolume -= inventoryTemplate.volume;
const inventoryIndex = inventoryList.indexOf(inventoryTemplate);
if (inventoryIndex === -1) return;
const removeIndex = cargoAbundance.indexOf(inventoryIndex);
Expand All @@ -83,7 +84,7 @@ export function generateShipInventory(
* to the cargo hold
*/
const roomMap = rooms.reduce(
(acc: {[key: string]: typeof rooms[0][]}, room) => {
(acc: {[key: string]: (typeof rooms)[0][]}, room) => {
room.flags.forEach(flag => {
if (!acc[flag]) acc[flag] = [];
if (flag !== "cargo") {
Expand Down

0 comments on commit d1062c7

Please sign in to comment.