An event for when a surface's pollutant type is changed

Place to ask discuss and request the modding support of Factorio. Don't request mods here.
User avatar
PennyJim
Fast Inserter
Fast Inserter
Posts: 193
Joined: Wed Jan 18, 2023 3:49 am
Contact:

An event for when a surface's pollutant type is changed

Post by PennyJim »

Now that you can set an override_pollution_type, mods that handle pollution in special ways might need to be aware of when it changes.

I specifically need it because I keep track specific entities and whether or not their chunk exceeds their working pollution range. The loop for this is pretty simple, but I realized I didn't actually support alternative pollutant types.
To fix this, I added a placement-time check for if the surface's pollutant matches the one defined on the working range. This gets written to a flag to skip reading the pollution value in my on_tick and instead always treat it as 0. I'd rather not start checking the pollutant type within that same on_tick if I can help it.
Post Reply

Return to “Modding interface requests”