mirror of
https://github.com/clusterio/clusterio.git
synced 2026-11-24 00:23:12 +09:00
Always exit remote view on sync
This commit is contained in:
2 files changed
+1
-13
No files matched your search
@@ -116,11 +116,6 @@ function inventory_sync.deserialize_player(player, finished_record)
|
|||||||
-- Restore player position and driving state
|
-- Restore player position and driving state
|
||||||
restore_position(player, finished_record)
|
restore_position(player, finished_record)
|
||||||
|
|
||||||
-- Return to remote if needed (restore position may exit remote view)
|
|
||||||
if serialized_player.remote then
|
|
||||||
player.set_controller{ type = defines.controllers.remote }
|
|
||||||
end
|
|
||||||
|
|
||||||
-- Transfer items from stashed inventory
|
-- Transfer items from stashed inventory
|
||||||
if stashed_corpse then
|
if stashed_corpse then
|
||||||
local stash = stashed_corpse.get_inventory(defines.inventory.character_corpse)
|
local stash = stashed_corpse.get_inventory(defines.inventory.character_corpse)
|
||||||
|
|||||||
@@ -429,7 +429,6 @@ end
|
|||||||
--- @field generation number
|
--- @field generation number
|
||||||
--- @field name string
|
--- @field name string
|
||||||
--- @field controller string
|
--- @field controller string
|
||||||
--- @field remote boolean
|
|
||||||
--- @field color Color
|
--- @field color Color
|
||||||
--- @field chat_color Color
|
--- @field chat_color Color
|
||||||
--- @field tag string
|
--- @field tag string
|
||||||
@@ -452,7 +451,6 @@ function serialize.serialize_player(player, failed_deserialization)
|
|||||||
local serialized = {
|
local serialized = {
|
||||||
generation = 0, -- Gets replaced later
|
generation = 0, -- Gets replaced later
|
||||||
controller = controller_to_name[player.controller_type],
|
controller = controller_to_name[player.controller_type],
|
||||||
remote = false,
|
|
||||||
name = player.name,
|
name = player.name,
|
||||||
color = player.color,
|
color = player.color,
|
||||||
chat_color = player.chat_color,
|
chat_color = player.chat_color,
|
||||||
@@ -463,8 +461,8 @@ function serialize.serialize_player(player, failed_deserialization)
|
|||||||
ticks_to_respawn = player.ticks_to_respawn,
|
ticks_to_respawn = player.ticks_to_respawn,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
-- In 2.0 we want to sync the physical controller to ignore remote view
|
||||||
if v2_remote_controller then
|
if v2_remote_controller then
|
||||||
serialized.remote = player.controller_type == defines.controllers.remote
|
|
||||||
serialized.controller = controller_to_name[player.physical_controller_type]
|
serialized.controller = controller_to_name[player.physical_controller_type]
|
||||||
end
|
end
|
||||||
|
|
||||||
@@ -637,11 +635,6 @@ function serialize.deserialize_player(player, serialized)
|
|||||||
serialize.deserialize_crafting_notifications(player, serialized.recipe_notifications)
|
serialize.deserialize_crafting_notifications(player, serialized.recipe_notifications)
|
||||||
end
|
end
|
||||||
|
|
||||||
-- Return to remote view after physical controller has been synced
|
|
||||||
if serialized.remote then
|
|
||||||
player.set_controller{ type = defines.controllers.remote }
|
|
||||||
end
|
|
||||||
|
|
||||||
return next(failed_deserialization) and failed_deserialization or nil
|
return next(failed_deserialization) and failed_deserialization or nil
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|||||||
Reference in new issue
Block a user