script for debugging items being assigned to multiple squads - #902
Closed
chdoc wants to merge 1 commit into
Closed
Conversation
chdoc
force-pushed
the
equipment-conflicts
branch
from
November 22, 2023 10:58
ad56041 to
fbeea05
Compare
myk002
reviewed
Dec 20, 2023
myk002
left a comment
Member
There was a problem hiding this comment.
ugh, I forgot to actually submit my review. sorry for the delay.
| ========================= | ||
|
|
||
| .. dfhack-tool:: | ||
| :summary: Tool for debugging equipment conflicts |
Member
There was a problem hiding this comment.
Suggested change
| :summary: Tool for debugging equipment conflicts | |
| :summary: Tool for debugging equipment conflicts. |
| :summary: Tool for debugging equipment conflicts | ||
| :tags: dev | ||
|
|
||
| This script analyzes uniforms of squad members and reports items that are |
Member
There was a problem hiding this comment.
Aren't "uniforms" the templates, and not the actual worn items?
Comment on lines
+1
to
+6
| --[[ | ||
|
|
||
| This script analyzes uniforms of squad members and reports items that are | ||
| claimed by more than one squad member. | ||
|
|
||
| --]] |
Member
There was a problem hiding this comment.
this is already in the docs and doesn't need to be repeated here
Comment on lines
+15
to
+21
| local function addToNestedTable(outer_table, outer_key, value) | ||
| if outer_table[outer_key] then | ||
| table.insert(outer_table[outer_key],value) | ||
| else | ||
| outer_table[outer_key] = { value } | ||
| end | ||
| end |
Member
There was a problem hiding this comment.
can replace with table.insert(ensure_key(outer_table, outer_key), value)
| end | ||
|
|
||
| -- analyze uniforms of squad members | ||
| for _, unit in pairs(dfhack.units.getCitizens(true)) do |
Member
There was a problem hiding this comment.
functionally the same, but semantically, this is an ipairs
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
For what its worth, here is the script I wrote to debug the equipment situation in one of my forts.
Is would be nice if someone could check that the logic is sound.
Of course, it would be nice to automatically fix the conflicts, but doing so requires further analysis.