Caught by another in-game crash: "Entity is not resource." when
reading entity.amount. The previous fix (collision_mask: "resource")
was still wrong - collision layers and entity type are decoupled in
Factorio 2.0, so find_entities_filtered({collision_mask: "resource"})
can return non-resource entities that merely opted into the same
collision layer (likely something from Space Exploration or
Krastorio 2). entity.amount/initial_amount only exist on entities
whose prototype type is actually "resource".
Filtering by type: "resource" directly targets the right entities
and is simpler than inferring it via collision mask in the first
place.
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
|
||
|---|---|---|
| .. | ||
| src/main | ||
| build.gradle.kts | ||
| mod-portal-description.md | ||
| package-lock.json | ||
| package.json | ||
| tsconfig.json | ||