Skip to content

Conversation

@GladieUO
Copy link
Contributor

So i compared the old code with the new one, and there seems to be some mismatches with n16_narrow_n8 and n32_narrow_n8_checked making it dont work.
I also added one condition that was missing, and one extra line.

No idea if its proper fix, however it works.

#1478

fix custom multi building for above levels
@cbnolok
Copy link
Contributor

cbnolok commented Sep 30, 2025

Thanks for the research and good finding!
Could you check if the problem lies only in the last cast (in GetPlaneZ)? The other casts look legit and i prefer having a widespread use of the named casts to get an immediate idea both of the input and output types.
Also, naword wPlaneBuffer[PLANEDATA_BUFFER]{} declaration should already zero-initialize the array (because of the ending {}), so memset should be redundant.

@GladieUO
Copy link
Contributor Author

GladieUO commented Sep 30, 2025

I tried like 10 different variants, but nothing just this worked. Removing the memset breaks this too, just tried that, together with the GetPlaneZ -> if I change only this, it will break the movement between the floors in customizer.

@cbnolok
Copy link
Contributor

cbnolok commented Sep 30, 2025

Thank you, i'd ask you the last favor: could you log the values of both the named cast and the static cast? To see where and how they do differ

@GladieUO
Copy link
Contributor Author

GladieUO commented Oct 1, 2025

So I tried to log both the named and static, and both showed same numbers, which points to it being fine. So I reverted the whole fix, and added only the memset(wPlaneBuffer, 0, sizeof(wPlaneBuffer)); part. And its working just with that.

change the fix, only one line fixes the problem
@cbnolok
Copy link
Contributor

cbnolok commented Oct 1, 2025

Okay it looks like zero-init via naword wPlaneBuffer[PLANEDATA_BUFFER]{} doesn't work because of silly C++ rules (might not be considered as a POD/aggregate type because of inheritance and custom constructors/disabled templated assignment operators). Memset is the way to go then, merging

@cbnolok cbnolok merged commit 2a18521 into Sphereserver:dev Oct 1, 2025
16 of 18 checks passed
@GladieUO GladieUO deleted the DEV-MAIN branch October 1, 2025 13:43
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.

2 participants