Typo in command deleted everything.

This subforum contains all the issues which we already resolved.
nik12111
Burner Inserter
Burner Inserter
Posts: 13
Joined: Sun Apr 16, 2017 6:50 pm
Contact:

Typo in command deleted everything.

Post by nik12111 »

Hey,

I ran a command to delete all enemies. however i made a typo. I typed enemies instead of enemy. Now literally everything is deleted. Shouldn't actually the command just not do anything since the force doesn't exist?

Code: Select all

/c local surface = game.player.surface  for c in surface.get_chunks() do  for key, entity in pairs(surface.find_entities_filtered({area={{c.x * 32, c.y * 32}, {c.x * 32 + 32, c.y * 32 + 32}}, force = "enemies"})) do  entity.destroy()  end  end

Kind regards,
nik12111
Rseding91
Factorio Staff
Factorio Staff
Posts: 14363
Joined: Wed Jun 11, 2014 5:23 am
Contact:

Re: Typo in command deleted everything.

Post by Rseding91 »

Thanks for the report. I've fixed it for 0.15: It will now give an error when an invalid force name is provided.
If you want to get ahold of me I'm almost always on Discord.
raute
Manual Inserter
Manual Inserter
Posts: 4
Joined: Sun Apr 16, 2017 7:34 pm
Contact:

Re: Typo in command deleted everything.

Post by raute »

from dev to dev: what was the cause? was the filter just ignored due to that error?
Rseding91
Factorio Staff
Factorio Staff
Posts: 14363
Joined: Wed Jun 11, 2014 5:23 am
Contact:

Re: Typo in command deleted everything.

Post by Rseding91 »

raute wrote:from dev to dev: what was the cause? was the filter just ignored due to that error?
Yes, it iterated each force and if it didn't find one with the given name it just gave "no force" back which is the same as telling the search "don't check for a specific force".
If you want to get ahold of me I'm almost always on Discord.
Post Reply

Return to “Resolved Problems and Bugs”