mirror of
https://github.com/PHIDIAS0303/ExpCluster.git
synced 2025-12-30 12:31:41 +09:00
Fixed missing output
This commit is contained in:
@@ -128,7 +128,7 @@ Selection.on_selection(SelectionProtectEntity, function(event)
|
|||||||
EntityProtection.add_entity(entity)
|
EntityProtection.add_entity(entity)
|
||||||
show_protected_entity(player, entity)
|
show_protected_entity(player, entity)
|
||||||
end
|
end
|
||||||
return Commands.success{'expcom-protection.protected-entities', #event.entities}
|
player.print{'expcom-protection.protected-entities', #event.entities}
|
||||||
end)
|
end)
|
||||||
|
|
||||||
--- When an area is selected to remove protection from entities
|
--- When an area is selected to remove protection from entities
|
||||||
@@ -138,22 +138,22 @@ Selection.on_alt_selection(SelectionProtectEntity, function(event)
|
|||||||
EntityProtection.remove_entity(entity)
|
EntityProtection.remove_entity(entity)
|
||||||
remove_render(player, get_entity_key(entity))
|
remove_render(player, get_entity_key(entity))
|
||||||
end
|
end
|
||||||
return Commands.success{'expcom-protection.unprotected-entities', #event.entities}
|
player.print{'expcom-protection.unprotected-entities', #event.entities}
|
||||||
end)
|
end)
|
||||||
|
|
||||||
--- When an area is selected to add protection to the area
|
--- When an area is selected to add protection to the area
|
||||||
Selection.on_selection(SelectionProtectArea, function(event)
|
Selection.on_selection(SelectionProtectArea, function(event)
|
||||||
local area = aabb_align_expand(event.area)
|
local area = aabb_align_expand(event.area)
|
||||||
local areas = EntityProtection.get_areas(event.surface)
|
local areas = EntityProtection.get_areas(event.surface)
|
||||||
|
local player = game.get_player(event.player_index)
|
||||||
for _, next_area in pairs(areas) do
|
for _, next_area in pairs(areas) do
|
||||||
if aabb_area_enclosed(area, next_area) then
|
if aabb_area_enclosed(area, next_area) then
|
||||||
return Commands.error{'expcom-protection.already-protected'}
|
return player.print{'expcom-protection.already-protected'}
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
local player = game.get_player(event.player_index)
|
|
||||||
EntityProtection.add_area(event.surface, area)
|
EntityProtection.add_area(event.surface, area)
|
||||||
show_protected_area(player, event.surface, area)
|
show_protected_area(player, event.surface, area)
|
||||||
return Commands.success{'expcom-protection.protected-area'}
|
player.print{'expcom-protection.protected-area'}
|
||||||
end)
|
end)
|
||||||
|
|
||||||
--- When an area is selected to remove protection from the area
|
--- When an area is selected to remove protection from the area
|
||||||
@@ -164,7 +164,7 @@ Selection.on_alt_selection(SelectionProtectArea, function(event)
|
|||||||
for _, next_area in pairs(areas) do
|
for _, next_area in pairs(areas) do
|
||||||
if aabb_area_enclosed(next_area, area) then
|
if aabb_area_enclosed(next_area, area) then
|
||||||
EntityProtection.remove_area(event.surface, next_area)
|
EntityProtection.remove_area(event.surface, next_area)
|
||||||
Commands.print{'expcom-protection.unprotected-area'}
|
player.print{'expcom-protection.unprotected-area'}
|
||||||
remove_render(player, get_area_key(next_area))
|
remove_render(player, get_area_key(next_area))
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|||||||
Reference in New Issue
Block a user