the quest that requests for an extractor to be built didn't take into account the built extractor #145

Closed
opened 2026-08-28 13:47:21 +00:00 by metaheavens · 1 comment
Owner

maybe it is because I was dead betwee the quest was given and the extrator was built? That's just a supposition, maybe the quest is simpliy bugged

maybe it is because I was dead betwee the quest was given and the extrator was built? That's just a supposition, maybe the quest is simpliy bugged
Author
Owner

Done in 2206b55. Your supposition was wrong in a good way - it was not about dying, and it was not intermittent. The quest could never be completed by anyone.

Extractors are not in buildings. They are placed onto a planet from space and live in GameState.extractors, with their own position, stock and id. The quest goal asked has_building_of_type("extractor"), which walks buildings - so it was false however many extractors you built, forever. My bug, from #133.

structure_exists() is now the question anything wanting "does the player have one of these" should ask, and the quest model asks it. (The two remaining has_building_of_type() callers are about unique structures - the mothership - where the answer really is about that list.)

The regression test is the part worth keeping: for every structure quest in the chain it builds the target the way the game builds it, and watches the goal flip. It does not know which array anything lands in - the knowing is exactly what got this wrong. So a future quest asking for something else stored off to one side fails the test instead of shipping.

Done in `2206b55`. Your supposition was wrong in a good way - it was not about dying, and it was not intermittent. The quest could never be completed by anyone. Extractors are not in `buildings`. They are placed onto a planet from space and live in `GameState.extractors`, with their own position, stock and id. The quest goal asked `has_building_of_type("extractor")`, which walks `buildings` - so it was false however many extractors you built, forever. My bug, from #133. `structure_exists()` is now the question anything wanting "does the player have one of these" should ask, and the quest model asks it. (The two remaining `has_building_of_type()` callers are about `unique` structures - the mothership - where the answer really is about that list.) The regression test is the part worth keeping: for **every** structure quest in the chain it builds the target the way the game builds it, and watches the goal flip. It does not know which array anything lands in - the knowing is exactly what got this wrong. So a future quest asking for something else stored off to one side fails the test instead of shipping.
Sign in to join this conversation.
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
metaheavens/spaceship#145
No description provided.