mirror of
https://mirror.ghproxy.com/https://github.com/dexyfex/CodeWalker
synced 2024-08-21 17:39:20 +08:00
Selected CarGen using popGroup for vehicle model set
This commit is contained in:
parent
3e46c2e60a
commit
81e24ef86f
@ -1358,6 +1358,16 @@ namespace CodeWalker.GameFiles
|
|||||||
BBMax = new Vector3(hlen);
|
BBMax = new Vector3(hlen);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public string NameString()
|
||||||
|
{
|
||||||
|
MetaHash mh = _CCarGen.carModel;
|
||||||
|
if ((mh == 0) && (_CCarGen.popGroup != 0))
|
||||||
|
{
|
||||||
|
mh = _CCarGen.popGroup;
|
||||||
|
}
|
||||||
|
return mh.ToString();
|
||||||
|
}
|
||||||
|
|
||||||
public override string ToString()
|
public override string ToString()
|
||||||
{
|
{
|
||||||
return _CCarGen.carModel.ToString() + ", " + Position.ToString() + ", " + _CCarGen.popGroup.ToString() + ", " + _CCarGen.livery.ToString();
|
return _CCarGen.carModel.ToString() + ", " + Position.ToString() + ", " + _CCarGen.popGroup.ToString() + ", " + _CCarGen.livery.ToString();
|
||||||
|
15
WorldForm.cs
15
WorldForm.cs
@ -3161,6 +3161,19 @@ namespace CodeWalker
|
|||||||
SelectedCarGenEntity.SetOrientation(cgori);
|
SelectedCarGenEntity.SetOrientation(cgori);
|
||||||
|
|
||||||
uint carhash = cg._CCarGen.carModel;
|
uint carhash = cg._CCarGen.carModel;
|
||||||
|
if ((carhash == 0) && (cg._CCarGen.popGroup != 0))
|
||||||
|
{
|
||||||
|
//find the pop group... and choose a vehicle..
|
||||||
|
var stypes = Scenarios.ScenarioTypes;
|
||||||
|
if (stypes != null)
|
||||||
|
{
|
||||||
|
var modelset = stypes.GetVehicleModelSet(cg._CCarGen.popGroup);
|
||||||
|
if ((modelset != null) && (modelset.Models != null) && (modelset.Models.Length > 0))
|
||||||
|
{
|
||||||
|
carhash = JenkHash.GenHash(modelset.Models[0].NameLower);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
if (carhash == 0) carhash = 418536135; //"infernus"
|
if (carhash == 0) carhash = 418536135; //"infernus"
|
||||||
|
|
||||||
YftFile caryft = gameFileCache.GetYft(carhash);
|
YftFile caryft = gameFileCache.GetYft(carhash);
|
||||||
@ -9484,7 +9497,7 @@ namespace CodeWalker
|
|||||||
}
|
}
|
||||||
if (CarGenerator != null)
|
if (CarGenerator != null)
|
||||||
{
|
{
|
||||||
name = CarGenerator.CCarGen.carModel.ToString();
|
name = CarGenerator.NameString();
|
||||||
}
|
}
|
||||||
if (EntityExtension != null)
|
if (EntityExtension != null)
|
||||||
{
|
{
|
||||||
|
Loading…
Reference in New Issue
Block a user