mirror of
https://github.com/Refactorio/RedMew.git
synced 2025-01-18 03:21:47 +02:00
Merge branch 'master' into develop
# Conflicts: # fish_market.lua
This commit is contained in:
commit
1f7364803c
@ -248,6 +248,7 @@ commands.add_command("tpplayer", "<player> - Teleports you to the player. (Admin
|
||||
commands.add_command("invoke", "<player> - Teleports the player to you. (Admins and moderators)", invoke)
|
||||
commands.add_command("tppos", "Teleports you to a selected entity. (Admins only)", teleport_location)
|
||||
commands.add_command("walkabout", '<player> <"close", "far", "very far", number> - Send someone on a walk. (Admins and moderators)', walkabout)
|
||||
commands.add_command("market", 'Places a fish market near you. (Admins only)', spawn_market)
|
||||
commands.add_command("settime", '<day> <month> <hour> <minute> - Sets the clock (Admins, moderators and regulars)', on_set_time)
|
||||
commands.add_command("clock", 'Look at the clock.', clock)
|
||||
commands.add_command("regulars", 'Prints a list of game regulars.', print_regulars)
|
||||
|
@ -17,9 +17,15 @@ make pet faster
|
||||
make pet follow you moar
|
||||
--]]
|
||||
|
||||
|
||||
|
||||
function market()
|
||||
game.player.print("This command moved to /market.")
|
||||
end
|
||||
|
||||
function spawn_market(cmd)
|
||||
if not game.player.admin then
|
||||
cant_run(cmd.name)
|
||||
return
|
||||
end
|
||||
local radius = 10
|
||||
local surface = game.surfaces[1]
|
||||
-- clear trees and landfill in start area
|
||||
@ -35,7 +41,7 @@ function market()
|
||||
end
|
||||
end
|
||||
|
||||
local player = game.players[1]
|
||||
local player = game.player
|
||||
|
||||
local market_location = {x = player.position.x, y = player.position.y}
|
||||
market_location.y = market_location.y - 4
|
||||
|
@ -140,6 +140,22 @@ local function get_sorted_list(sort_by)
|
||||
player_list[i2] = a
|
||||
end
|
||||
end
|
||||
if sort_by == "distance_asc" then
|
||||
if global.scenario.variables.player_walk_distances[player_list[i].name] > global.scenario.variables.player_walk_distances[player_list[i2].name] then
|
||||
local a = player_list[i]
|
||||
local b = player_list[i2]
|
||||
player_list[i] = b
|
||||
player_list[i2] = a
|
||||
end
|
||||
end
|
||||
if sort_by == "distance_desc" then
|
||||
if global.scenario.variables.player_walk_distances[player_list[i].name] < global.scenario.variables.player_walk_distances[player_list[i2].name] then
|
||||
local a = player_list[i]
|
||||
local b = player_list[i2]
|
||||
player_list[i] = b
|
||||
player_list[i2] = a
|
||||
end
|
||||
end
|
||||
if sort_by == "name_asc" then
|
||||
if player_list[i].name > player_list[i2].name then
|
||||
local a = player_list[i]
|
||||
|
Loading…
Reference in New Issue
Block a user