#61 fixed remoteMap deletions

This commit is contained in:
Danielv123 committed 2018-01-05 21:25:26 +01:00
1 parent a78a80f395
commit 52cc98cc95
2 files changed
+7 -2

No files matched your search

+1 -1
View File
@@ -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
View File
@@ -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"){