Page 1 of 1

Typo in command deleted everything.

Posted: Sun Apr 16, 2017 7:03 pm
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

Re: Typo in command deleted everything.

Posted: Sun Apr 16, 2017 7:10 pm
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.

Re: Typo in command deleted everything.

Posted: Sun Apr 16, 2017 7:36 pm
by raute
from dev to dev: what was the cause? was the filter just ignored due to that error?

Re: Typo in command deleted everything.

Posted: Sun Apr 16, 2017 8:06 pm
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".