Skip to content

Dev > Stable merge - #2592

Open
z16 wants to merge 21 commits into
stablefrom
dev
Open

z16 wants to merge 21 commits into
stablefrom
dev

Conversation

@z16

@z16 z16 commented Nov 11, 2026

Copy link
Copy Markdown
Member

No description provided.

Zirk40 and others added 21 commits October 11, 2026 17:35
Renamed line to rline to keep find_monster_skill consistent with the above
spell_complete function.
[GearSwap] Move helper function to helper_functions
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 change should have been included in commit 7db6cc6 but was missed.
[GearSwap] equip_sets_exit pretarget cleanup part 1
The current code path is a bit tangled and not cohesive, as demonstrated by
the "This case should not be hittable - 2" being hit for any item trades where
the target is greater than 6 yalms away, which is a very real scenario.

The overall code path should be pretty straightforward, either we succeeded in
assembling a proposed packet and will proceed into the precast event, or we
didn't get a proposed packet and will do some cleanup before bailing out and
letting the client handle the action.

Assigning nil to storedcommand is not necessary as part of cleanup, as any
subsequent outgoing text trigger is guaranteed to assign a new value to
storedcommand before storedcommand is ever used, so it is not possible for a
stale value to persist from a previous trigger and be utilized.

The same cleanup steps are added to outgoing text for consistency.

We shouldn't be doing the val1.target.name check because filter_precast
already validates the target by checking .target.id and .target.index, so
inside filter_precast code block is where we have a valid target and outside
filter_precast code block is where we don't have a valid target, we don't need
to check for valid target in multiple places.

The debug message about "Change target was used to pick an invalid target" was
modified because that debug message lies most of the time, most often change
target was not exercised and the original command contained <t> without any
target selected, for example.

In order for an action to be a trade, the item must be in the inventory with a
status of 0, so this find_inventory_item check should be baked into
the trade determination. Before this commit, it was possible to have an item
action_type labeled as a trade, but we still end up assembling an item use
packet instead of a trade packet if the find_inventory_item check failed but
the find_usable_item check succeeded. With this commit, we only set the
action_type as trade if it really is a trade.

As part of this commit's untangling of things, GearSwap will no longer fake
out the "Target out of range" message for out of range trades, and will
instead do the proper thing of letting the client handle that action and print
out a native out of range message, along with the native feedback of echoing
the input command that produced the out of range message. Outgoing text is
also updated to no longer fake out these out of range trades to remain
consistent.
[GearSwap] equip_sets_exit pretarget cleanup part 2
GearSwap currently uses a bit of a hacky method to do delayed casts that
relies on the console wait command, which also introduces an additional code
path with the pretarget_delayed_cast and precast_delayed_cast functions. This
commit switches to using the more proper, robust method of the coroutine
scheduler which also ensures all casts, delayed or not, take the identical
code path.
Logger was previously only stripping color codes from the message. This update changes it to first convert Auto-Translate text to normal text, then strip colors, and finally turn the Shift-JIS text into UTF-8.
[GearSwap] Use coroutine scheduler to do delayed casts
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

8 participants