Repository navigation
[GearSwap] equip_sets_exit pretarget cleanup part 1 - #2580
Merged
Merged
Conversation
outgoing text does a good job identifying if an item action is a trade or regular item use, but this check should be reperformed in the event the user pretarget function changes the target, since the target being an NPC or not affects if the requested action is a trade or not. Pretarget will use this this trade determination to decide which item packet to assemble in the same manner as outgoing text to maintain consistency. filter_precast was upset that it only exists to do a single job, but an imposter was doing its job for it, so it ejected the imposter. The outgoing_action_category_table check is unnecessary as the only way this check can fail is if we do not have a valid unified prefix, but outgoing text already validated the prefix. Checking for the existence of command_registry[ts].proposed_packet was common to both item and action packet code paths, so it was pulled out to a common location to reduce code duplication. After filter_precast ejected the imposter, there was a situation where one filter_precast check was nested inside another filter_precast check, so the inner check was removed since it is guaranteed to evaluate to true. Dead code inside the action packet code path was deleted. This code is dead because its impossible for assemble_action_packet to return nil or false, and this is verifiable empirically because if the dead code were to ever execute, it is guaranteed to produce an error since it will concatenate nil with a string, and we'd have seen reports of this error by now.
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.
outgoing text does a good job identifying if an item action is a trade or regular item use, but this check should be reperformed in the event the user pretarget function changes the target, since the target being an NPC or not affects if the requested action is a trade or not. Pretarget will use this this trade determination to decide which item packet to assemble in the same manner as outgoing text to maintain consistency.
filter_precast was upset that it only exists to do a single job, but an imposter was doing its job for it, so it ejected the imposter.
The outgoing_action_category_table check is unnecessary as the only way this check can fail is if we do not have a valid unified prefix, but outgoing text already validated the prefix.
Checking for the existence of command_registry[ts].proposed_packet was common to both item and action packet code paths, so it was pulled out to a common location to reduce code duplication.
After filter_precast ejected the imposter, there was a situation where one filter_precast check was nested inside another filter_precast check, so the inner check was removed since it is guaranteed to evaluate to true.
Dead code inside the action packet code path was deleted. This code is dead because its impossible for assemble_action_packet to return nil or false, and this is verifiable empirically because if the dead code were to ever execute, it is guaranteed to produce an error since it will concatenate nil with a string, and we'd have seen reports of this error by now.