mirror of
https://github.com/DrBeef/JKXR.git
synced 2024-11-21 19:51:33 +00:00
Prevent crash when throwing Saber
seems it is indexing the g2 model surface that doesn't exist, might be something to do with the new hilt and the old hilt being in the save. Not sure, but this stops it crashing.
This commit is contained in:
parent
d841464924
commit
a3fdb460c4
1 changed files with 4 additions and 1 deletions
|
@ -1769,7 +1769,10 @@ void *G2_FindSurface(const model_s *mod, int index, int lod)
|
|||
|
||||
mdxmLODSurfOffset_t *indexes = (mdxmLODSurfOffset_t *)current;
|
||||
// we are now looking at the offset array
|
||||
assert(index>=0&&index<mod->mdxm->numSurfaces);
|
||||
if (index >= mod->mdxm->numSurfaces)
|
||||
{
|
||||
index = mod->mdxm->numSurfaces-1;
|
||||
}
|
||||
current += indexes->offsets[index];
|
||||
|
||||
return (void *)current;
|
||||
|
|
Loading…
Reference in a new issue