mirror of
https://mirror.ghproxy.com/https://github.com/dexyfex/CodeWalker
synced 2024-11-29 18:32:55 +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)
|
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);
|
WriteNode(sb, cind, cont, ptrVal.BlockID, (int)ptrVal.ItemOffset, XmlTagMode.None, (MetaName)entry.ReferenceKey);
|
||||||
|
CloseTag(sb, cind, ename);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
@ -83,7 +83,16 @@ namespace CodeWalker.GameFiles
|
|||||||
}
|
}
|
||||||
case PsoDataType.Structure:
|
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)
|
if (struc != null)
|
||||||
{
|
{
|
||||||
switch (entry.Unk_5h)
|
switch (entry.Unk_5h)
|
||||||
@ -99,7 +108,7 @@ namespace CodeWalker.GameFiles
|
|||||||
case 3: //structure pointer...
|
case 3: //structure pointer...
|
||||||
case 4: //also pointer? what's the difference?
|
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);
|
var ptr = new PsoPOINTER(bptr.BlockID, bptr.Offset, 0);
|
||||||
ptr.SwapEnd();
|
ptr.SwapEnd();
|
||||||
var ptrb = MetaTypes.ConvertToBytes(ptr);
|
var ptrb = MetaTypes.ConvertToBytes(ptr);
|
||||||
@ -109,6 +118,8 @@ namespace CodeWalker.GameFiles
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
{ }
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case PsoDataType.Map:
|
case PsoDataType.Map:
|
||||||
@ -348,6 +359,8 @@ namespace CodeWalker.GameFiles
|
|||||||
return data;
|
return data;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
{ }//info not found
|
||||||
|
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user