-
Notifications
You must be signed in to change notification settings - Fork 759
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix Soul Balls in newer clients #3291
Conversation
71d33f4
to
dc9bd31
Compare
case BALL_TYPE_NONE: | ||
break; | ||
} | ||
clif->send(&p, sizeof(struct PACKET_ZC_SPIRITS), ((bl == NULL && spirit == BALL_TYPE_SOUL) ? &sd->bl : bl), (spirit == BALL_TYPE_SPIRIT ? AREA : target)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the logic here in previous version is somewhat confusing to me, but:
nullpo_retv(bl);
at the start, so(bl == NULL && ..)
is always false, thusbl
is always the target (Well, it would be anyway)- the
target
for SPIRIT is alwaysAREA
, this is given by the caller already.
so simply changing to bl, target
is equivalent.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- I agree
target
is not alwaysAREA
dc9bd31
to
002346c
Compare
src/map/clif.c
Outdated
@@ -9761,7 +9751,7 @@ static void clif_refresh(struct map_session_data *sd) | |||
if (sd->charm_type != CHARM_TYPE_NONE && sd->charm_count > 0) | |||
clif->charm_single(sd->fd, sd); | |||
if (sd->soulball > 0) | |||
clif->spiritball(&sd->bl, BALL_TYPE_SOUL, SELF); | |||
clif->soulball(&sd->bl, sd->soulball, SELF); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Like this one.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
oh, what I tried to say is that for BALL_TYPE_SPIRIT
, clif->spiritball
is already called with AREA
every time, no need to "hardcode" it in the ternary (thus, simply using target
is enough). Just trying to justify that removing the ternary was safe, because clif->spiritball
was already called with AREA every time it was called for "spirit ball" instead of "soul ball".
This one was not AREA
, but it was also not BALL_TYPE_SPIRIT
- newer clients uses separate packets, making a mess to handle both in the same function - those functions now expect caller to give the number of balls, since most of the time there is a "generalization" to be "specialized" again
spirit spheres and soul balls are handled separately in newer clients, and thus, using ZC_SPIRITS always show spirit balls, even for classes that would show soul balls before
Pull Request Prelude
Changes Proposed
Fixes soul balls not being properly displayed in newer clients. (2020+).
2020+ clients split the logic for spirit spheres and soul balls, players may now have both at the same time, and a new packet was introduced for soul balls only (being separated from the spirit spheres one).
Implementation based on rAthena logic/packet. also huge thanks to 4144 for packet dates.
I decided to split
clif_spiritball
into 2 functions and leave the number of balls to the caller so we can simplify those functions. There were 2 reasons for that:Issues addressed:
None, I think (someone mentioned it in discord)