Skip to content

Commit

Permalink
Retain accumulator charge and temperature
Browse files Browse the repository at this point in the history
  • Loading branch information
Danielv123 committed Apr 27, 2024
1 parent 084c689 commit c5d5790
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
6 changes: 6 additions & 0 deletions module/universal_serializer/classes/LuaEntity_deserialize.lua
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,12 @@ local function entity_deserialize(serialized_entity, is_already_delayed)
return nil
end

if entity_data.energy ~= nil then
entity.energy = entity_data.energy
end
if entity_data.temperature ~= nil then
entity.temperature = entity_data.temperature
end
if entity.supports_backer_name() then
entity.backer_name = entity_data.backer_name
end
Expand Down
2 changes: 2 additions & 0 deletions module/universal_serializer/classes/LuaEntity_serialize.lua
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@ local function entity_serialize(entity)
orientation = entity.orientation,
force = entity.force.name,
player = entity.last_user and entity.last_user.name or nil,
energy = entity.energy,
temperature = entity.temperature,
}
if entity.supports_backer_name() then
entity_data.backer_name = entity.backer_name
Expand Down

0 comments on commit c5d5790

Please sign in to comment.