I have a mod (Factorio World) that spawns basic resources when a player is teleported to a location:
Code: Select all
surface.create_entity({name="crude-oil", amount=START_OIL_AMOUNT, position={oil_patch_x, oil_patch_y}})
However, I have learned that at least one mod deletes the resource "crude-oil", which causes my mod to fail.
Code: Select all
data.raw.resource["crude-oil"] = nil
I tried adding a simple check in my script:
Code: Select all
if data.raw.resource["crude-oil"] then
Perhaps I am missing something obvious.
Any suggestions?
thanks,
jon