diff --git a/sharedPlugins/remoteMap/control.lua b/sharedPlugins/remoteMap/control.lua index d5fa7b2f..8e7b8e42 100644 --- a/sharedPlugins/remoteMap/control.lua +++ b/sharedPlugins/remoteMap/control.lua @@ -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 diff --git a/static/remoteMap.js b/static/remoteMap.js index fe4cfbd8..b0a488fa 100644 --- a/static/remoteMap.js +++ b/static/remoteMap.js @@ -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"){