Typo in command deleted everything.

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

Typo in command deleted everything.

Post by nik12111 » Sun Apr 16, 2017 7:03 pm

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: 9431
Joined: Wed Jun 11, 2014 5:23 am
Contact:

Re: Typo in command deleted everything.

Post by Rseding91 » Sun Apr 16, 2017 7:10 pm

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 » Sun Apr 16, 2017 7:36 pm

from dev to dev: what was the cause? was the filter just ignored due to that error?

Rseding91
Factorio Staff
Factorio Staff
Posts: 9431
Joined: Wed Jun 11, 2014 5:23 am
Contact:

Re: Typo in command deleted everything.

Post by Rseding91 » Sun Apr 16, 2017 8:06 pm

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”

Who is online

Users browsing this forum: Atraps003, Bing [Bot], Extrien, wellczech, XaLpHa89