Healing Walls


Walls that heal!

Utilities
7 years ago
0.14
24

b Does it work in multiplayer?

7 years ago

Hi!
Does that work in multiplayer?

Or do you need to iterate through all the players with something like this?

<pre>for i, obj in pairs(game.players) do local surface = obj.surface walls = surface.find_entities_filtered{name="stone-wall"} for i = 1, surface.count_entities_filtered{name="stone-wall"}, 1 do walls[i].health = walls[i].health + amount_to_heal end end </pre>

Thanks!
Mete

7 years ago

As far as I can tell, since it only uses the player for getting the surface, it shouldn't need to iterate through the players and should work in multiplayer (though I haven't tested this). It might stop healing (temporarily) while you're in a Factorissimo building however since that changes your surface, and very likely does strange things if there's more than one force of players on the map. I'll try to fix it up later today to work with multiple surfaces and forces.

New response