previous_target for on_marked_for_upgrade
- _CodeGreen
- Long Handed Inserter
- Posts: 92
- Joined: Sat Mar 05, 2022 11:30 am
- Contact:
previous_target for on_marked_for_upgrade
I've been trying to figure out how to fix a certain bug with redo, which involves upgrading the same entity twice in a row. The first upgrade works fine, but the second upgrade is causing some trouble. on_marked_for_upgrade happens after the entity was marked, which makes sense, but there's no way for me to tell what the entity was supposed to be upgraded into before giving it a new upgrade. An on_pre_marked_for_upgrade event is not necessary, but as the title says, an event data field like previous_target would completely solve that issue.
My Mods | If you can't make it perfect, make it adjustable
Re: previous_target for on_marked_for_upgrade
While it won't help with your mod anymore since redo is now part of the base game, I still added previous_target and previous_quality to the on_marked_for_upgrade event for 2.0.67.
I'm an admin over at https://wiki.factorio.com. Feel free to contact me if there's anything wrong (or right) with it.
- protocol_1903
- Filter Inserter
- Posts: 324
- Joined: Fri Sep 09, 2022 4:33 pm
- Contact:
Re: previous_target for on_marked_for_upgrade
Thats an awesome fix. Thank you!Bilka wrote: Thu Sep 11, 2025 2:17 pm While it won't help with your mod anymore since redo is now part of the base game, I still added previous_target and previous_quality to the on_marked_for_upgrade event for 2.0.67.
If you need to reach me, message me on discord.
I make qol mods. Check them out, maybe.
https://mods.factorio.com/user/protocol_1903
If you have a mod idea, I can look into it.
I make qol mods. Check them out, maybe.
https://mods.factorio.com/user/protocol_1903
If you have a mod idea, I can look into it.