Closed leevccc closed 1 week ago
Is this kind of recursive linking used in any version of vanilla WZ files, and does the client support this?
This is also not the right way to go about supporting this, since the mobProperty object for a linked mob will not contain anything. Instead you want to resolve the original mob when you're processing the linked mobs.
--- a/src/main/java/kinoko/provider/MobProvider.java
+++ b/src/main/java/kinoko/provider/MobProvider.java
@@ -53,7 +53,10 @@ public final class MobProvider implements WzProvider {
// Process linked mobs
for (var linkEntry : linkedMobs.entrySet()) {
final int mobId = linkEntry.getKey();
- final int link = linkEntry.getValue().getLeft();
+ int link = linkEntry.getValue().getLeft();
+ while (!mobProperties.containsKey(link)) {
+ link = linkedMobs.get(link).getLeft();
+ }
final WzListProperty linkProp = mobProperties.get(link);
if (linkProp == null) {
throw new ProviderError("Failed to resolve linked mob ID : %d, link : %d", mobId, link);
I've confirmed that the v95 client does support recursive links for mobs like you've described (oddly this seems to only work for mobs), but will be applying the above fix. Thanks for reporting this issue nonetheless!
it will error when mobA link mobB, and mobB link mobC in Mob.wz
error in line 60