ReikaKalseki / Reika_FactorioMods_Issues

The issue tracker for all of my Factorio mods - EndgameCombat, NauvisDay, Geothermal, Oreverhaul, and the rest.
5 stars 1 forks source link

last_user and cloning entities leads to crashing #200

Open PyroFire232 opened 5 years ago

PyroFire232 commented 5 years ago
  1. Your mod doesn't copy over last_user from turrets when upgrading/replacing them with a higher tier entity.

  2. Your mod seems to crash when entities are cloned, or are made invalid. (particularly shield generator)

ReikaKalseki commented 5 years ago

(1) is easy to fix, but I have not seen (2). Can you elaborate?

ReikaKalseki commented 4 years ago

The first has been fixed, but I cannot do anything about the second without more info.

PyroFire232 commented 4 years ago

https://mods.factorio.com/mod/warptorio2/faq

Warptorio then uses LuaSurface.clone_entities from the current_planet.surface to the new_planet.surface Each new entity created this way has defines.events.on_entity_cloned raised for it. In this event you need to simply update your internal caching and duplicate everything to the new entity so the 2 are identical, but on a different surface. Cloning does not typically happen in normal play, but to test it without mods, you can use the Clone feature in /editor. All players are then teleported to the new planet.

it's similar to on_built_entity

ReikaKalseki commented 4 years ago

That should not be too difficult.

ReikaKalseki commented 4 years ago

Is the second still an issue?