mirror of
https://mirror.ghproxy.com/https://github.com/dexyfex/CodeWalker
synced 2024-11-26 00:43:00 +08:00
Fixed bug in PSO/XML conversion for structure pointers
This commit is contained in:
parent
187f8379cd
commit
9506069e35
@ -885,7 +885,10 @@ namespace CodeWalker.GameFiles
|
||||
}
|
||||
if (pbok)
|
||||
{
|
||||
var typename = HashString(cont.Pso.GetBlock(pbid).NameHash);
|
||||
OpenTag(sb, cind, ename + " type=\"" + typename + "\"");
|
||||
WriteNode(sb, cind, cont, ptrVal.BlockID, (int)ptrVal.ItemOffset, XmlTagMode.None, (MetaName)entry.ReferenceKey);
|
||||
CloseTag(sb, cind, ename);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -83,7 +83,16 @@ namespace CodeWalker.GameFiles
|
||||
}
|
||||
case PsoDataType.Structure:
|
||||
{
|
||||
var struc = Traverse(cnode, pb, (MetaName)entry.ReferenceKey);
|
||||
var stype = (MetaName)entry.ReferenceKey;
|
||||
if (stype == 0)
|
||||
{
|
||||
var stypestr = Xml.GetStringAttribute(cnode, "type");
|
||||
if (!string.IsNullOrEmpty(stypestr))
|
||||
{
|
||||
stype = (MetaName)(uint)GetHash(stypestr);
|
||||
}
|
||||
}
|
||||
var struc = Traverse(cnode, pb, stype);
|
||||
if (struc != null)
|
||||
{
|
||||
switch (entry.Unk_5h)
|
||||
@ -99,7 +108,7 @@ namespace CodeWalker.GameFiles
|
||||
case 3: //structure pointer...
|
||||
case 4: //also pointer? what's the difference?
|
||||
|
||||
var bptr = pb.AddItem((MetaName)entry.ReferenceKey, struc);
|
||||
var bptr = pb.AddItem(stype, struc);
|
||||
var ptr = new PsoPOINTER(bptr.BlockID, bptr.Offset, 0);
|
||||
ptr.SwapEnd();
|
||||
var ptrb = MetaTypes.ConvertToBytes(ptr);
|
||||
@ -109,6 +118,8 @@ namespace CodeWalker.GameFiles
|
||||
break;
|
||||
}
|
||||
}
|
||||
else
|
||||
{ }
|
||||
break;
|
||||
}
|
||||
case PsoDataType.Map:
|
||||
@ -348,6 +359,8 @@ namespace CodeWalker.GameFiles
|
||||
return data;
|
||||
|
||||
}
|
||||
else
|
||||
{ }//info not found
|
||||
|
||||
return null;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user