mirror of
https://github.com/clusterio/clusterio.git
synced 2026-11-11 15:04:52 +09:00
Fixed bug with negative coordinates in remoteMap
This commit is contained in:
1 parent
9377eb9544
commit
e731fcb4a9
4 files changed
+11
-3
No files matched your search
@@ -63,3 +63,7 @@ sharedPlugins/scenario_loader/scenarios
|
||||
sharedPlugins/*/DISABLED
|
||||
|
||||
\.cache-require-paths\.json
|
||||
|
||||
\.vs/
|
||||
|
||||
bin/
|
||||
Binary file not shown.
Whitespace-only changes.
@@ -80,15 +80,15 @@ class masterPlugin {
|
||||
.split("|") // split into entities
|
||||
.map(str => str.replace("\n","")) // remove newlines that happen at the end of the last entity (maybe more as well???)
|
||||
.filter(str => str.length > 0) // remove blank entities
|
||||
.filter(str => !str.includes("tree") && // don't send entities that can't be rendered anyways
|
||||
.filter(str =>
|
||||
// !str.includes("tree") && // don't send entities that can't be rendered anyways
|
||||
!str.includes("dead") &&
|
||||
!str.includes("rock") &&
|
||||
// !str.includes("rock") &&
|
||||
!str.includes("crude-oil") &&
|
||||
!str.includes("remnants") &&
|
||||
!str.includes("cliff") &&
|
||||
!str.includes("player") &&
|
||||
!str.includes("ore"))
|
||||
.map(ent => ent.replace(/[-]/g, "_")) // replace - with _
|
||||
.map(ent => ent.split(",") // split entity into properties
|
||||
.map(prop => [prop.split(":")[0], prop.split(":")[1]]) // split properties into KV pairs
|
||||
)
|
||||
@@ -97,6 +97,10 @@ class masterPlugin {
|
||||
entity.forEach(property => entityObj[property[0]] = property[1])
|
||||
return entityObj
|
||||
})
|
||||
.map(entity => {
|
||||
entity.name = entity.name.replace(/[-]/g, "_") // replace - with _ in entity names as thats what factorio.blueprint-editor preffers
|
||||
return entity
|
||||
})
|
||||
.filter(entity => Object.keys(entity).length > 1)
|
||||
)
|
||||
})
|
||||
|
||||
Reference in new issue
Block a user