mirror of
https://mirror.ghproxy.com/https://github.com/dexyfex/CodeWalker
synced 2024-11-22 15:02:54 +08:00
Fix for vehicle wheels rendering corrupting the saved file
This commit is contained in:
parent
bd283a5c07
commit
60b1570930
@ -78,18 +78,21 @@ namespace CodeWalker.Rendering
|
||||
|
||||
DataSize = 0;
|
||||
|
||||
var hd = Key.DrawableModelsHigh.data_items;
|
||||
var hd = Key.DrawableModelsHigh?.data_items ?? Key.AllModels;
|
||||
var med = Key.DrawableModelsMedium?.data_items;
|
||||
var low = Key.DrawableModelsLow?.data_items;
|
||||
var vlow = Key.DrawableModelsVeryLow?.data_items;
|
||||
int totmodels = hd.Length + ((med != null) ? med.Length : 0) + ((low != null) ? low.Length : 0) + ((vlow != null) ? vlow.Length : 0);
|
||||
int curmodel = hd.Length;
|
||||
int totmodels = (hd?.Length ?? 0) + (med?.Length ?? 0) + (low?.Length ?? 0) + (vlow?.Length ?? 0);
|
||||
int curmodel = hd?.Length ?? 0;
|
||||
AllModels = new RenderableModel[totmodels];
|
||||
HDModels = new RenderableModel[hd.Length];
|
||||
for (int i = 0; i < hd.Length; i++)
|
||||
if (hd != null)
|
||||
{
|
||||
HDModels[i] = InitModel(hd[i]);
|
||||
AllModels[i] = HDModels[i];
|
||||
for (int i = 0; i < hd.Length; i++)
|
||||
{
|
||||
HDModels[i] = InitModel(hd[i]);
|
||||
AllModels[i] = HDModels[i];
|
||||
}
|
||||
}
|
||||
if (med != null)
|
||||
{
|
||||
|
@ -2338,12 +2338,12 @@ namespace CodeWalker.Rendering
|
||||
if ((dwbl != dwblcopy) && (dwbl.AllModels.Length == 0))
|
||||
{
|
||||
dwbl.Owner = dwblcopy;
|
||||
dwbl.AllModels = dwblcopy.AllModels;
|
||||
dwbl.DrawableModelsHigh = dwblcopy.DrawableModelsHigh;
|
||||
dwbl.DrawableModelsMedium = dwblcopy.DrawableModelsMedium;
|
||||
dwbl.DrawableModelsLow = dwblcopy.DrawableModelsLow;
|
||||
dwbl.DrawableModelsVeryLow = dwblcopy.DrawableModelsVeryLow;
|
||||
dwbl.VertexDecls = dwblcopy.VertexDecls;
|
||||
dwbl.AllModels = dwblcopy.AllModels; //hopefully this is all that's need to render, otherwise drawable is actually getting edited!
|
||||
//dwbl.DrawableModelsHigh = dwblcopy.DrawableModelsHigh;
|
||||
//dwbl.DrawableModelsMedium = dwblcopy.DrawableModelsMedium;
|
||||
//dwbl.DrawableModelsLow = dwblcopy.DrawableModelsLow;
|
||||
//dwbl.DrawableModelsVeryLow = dwblcopy.DrawableModelsVeryLow;
|
||||
//dwbl.VertexDecls = dwblcopy.VertexDecls;
|
||||
}
|
||||
|
||||
RenderDrawable(dwbl, arch, ent, txdhash);
|
||||
|
Loading…
Reference in New Issue
Block a user