mirror of
https://github.com/clusterio/clusterio.git
synced 2026-11-12 15:04:52 +09:00
#61 fixed remoteMap deletions
This commit is contained in:
1 parent
a78a80f395
commit
52cc98cc95
2 files changed
+7
-2
No files matched your search
@@ -91,7 +91,7 @@ function on_some_entity_deleted(event)
|
||||
--local area = {left_top={x=math.floor(ent.position.x), y=math.floor(ent.position.y)}, right_bottom={x=math.floor(ent.position.x)+1, y=math.floor(ent.position.y)+1}}
|
||||
|
||||
--table.insert(todo_next_tick, function () writeout_objects(surface, area ) end)
|
||||
write_file("deleted "..ent.position.x.." "..ent.position.y)
|
||||
write_file("deleted,"..ent.position.x..","..ent.position.y)
|
||||
--complain("on_some_entity_deleted: "..ent.name.." at "..ent.position.x..","..ent.position.y)
|
||||
end
|
||||
|
||||
|
||||
+6
-1
@@ -167,7 +167,12 @@ function drawEntity(entity, dontCache){
|
||||
if(!dontCache){
|
||||
// cache entity for later draws (like panning)
|
||||
if(entity.x - playerPosition.x/16 >= 0 && entity.x - playerPosition.x/16 < 64 && entity.y - playerPosition.y/16 >= 0 && entity.y - playerPosition.y/16 < 64){
|
||||
entityCache[entity.x - playerPosition.x/16][entity.y - playerPosition.y/16] = entity;
|
||||
if(entity.entity){
|
||||
entityCache[entity.x - playerPosition.x/16][entity.y - playerPosition.y/16] = entity;
|
||||
} else {
|
||||
// delete this entity because we just heard the tile is empty and stuff
|
||||
entityCache[entity.x - playerPosition.x/16][entity.y - playerPosition.y/16] = " ";
|
||||
}
|
||||
}
|
||||
}
|
||||
if(entity.entity && entity.entity.name && typeof entity.entity.name == "string"){
|
||||
|
||||
Reference in new issue
Block a user