previous_target for on_marked_for_upgrade

User avatar
_CodeGreen
Long Handed Inserter
Long Handed Inserter
Posts: 92
Joined: Sat Mar 05, 2022 11:30 am
Contact:

previous_target for on_marked_for_upgrade

Post by _CodeGreen »

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
Bilka
Factorio Staff
Factorio Staff
Posts: 3619
Joined: Sat Aug 13, 2016 9:20 am
Contact:

Re: previous_target for on_marked_for_upgrade

Post by Bilka »

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.
User avatar
protocol_1903
Filter Inserter
Filter Inserter
Posts: 324
Joined: Fri Sep 09, 2022 4:33 pm
Contact:

Re: previous_target for on_marked_for_upgrade

Post by protocol_1903 »

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.
Thats an awesome fix. Thank you!
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.
Post Reply

Return to “Implemented mod requests”