Allows players to load circuits via files/json input at the module duplicator using a circuit multitool#89
Open
hyperjll wants to merge 3 commits intopeppyrmynt:masterfrom
Open
Conversation
Using a circuit multitool on the module duplicator allows players to utilize the "Load Circuit" verb which is sorely under-utilized.
Collaborator
|
Hi I dont know how to comment on files but load_circuit_data() needs to be configured to sanitize external player input. /obj/item/integrated_circuit/proc/load_circuit_data(json_data, list/errors)
var/list/general_data = json_decode(json_data)
...
var/list/external_objects = general_data["external_objects"]
for(var/identifier in external_objects)
var/list/object_data = external_objects[identifier]
var/type = text2path(object_data["type"])
if(!ispath(type))
LOG_ERROR(errors, "Invalid path for external object, expected a path, got [type]")
continue
var/atom/movable/object = new type(drop_location())This needs to be fixed for the PR to work admin_only = general_data["admin_only"] |
Contributor
Author
|
Got any examples for me to work with? I'd prefer having the code look like something the maintainers want as opposed to whatever code spaghetti I might cook up. |
Collaborator
|
Ill check tomorrow, maybe |
Collaborator
|
I didnt see anything I liked, but heres some things it should do.
|
Removes file upload option, and makes the loading of circuit data safer by preventing runtimes and preventing the circuit from being admin-only.
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.
About The Pull Request
Gives players an option to quickly load circuits they've made and saved in JSON code. It's sad there's no option to save circuits between rounds.
Why It's Good For The Game
Cuts down on a LOT of repetition in making circuits, as well as allowing players to preserve any progress they've made should a round end too quickly.
Changelog
🆑
add: Using a circuit multitool on a module duplicator allows you to load circuits via local files or JSON input.
/:cl: