Skip to content

Commit f6a7b85

Browse files
committed
merge: Merge WW3D2/hlod
- Add boneindex safeguard from ZH to Gen
1 parent 0005356 commit f6a7b85

File tree

2 files changed

+10
-2
lines changed

2 files changed

+10
-2
lines changed

Generals/Code/Libraries/Source/WWVegas/WW3D2/hlod.cpp

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
** Command & Conquer Generals(tm)
2+
** Command & Conquer Generals Zero Hour(tm)
33
** Copyright 2025 Electronic Arts Inc.
44
**
55
** This program is free software: you can redistribute it and/or modify
@@ -3511,6 +3511,14 @@ void HLodClass::Add_Lod_Model(int lod, RenderObjClass * robj, int boneindex)
35113511
{
35123512
WWASSERT(robj != NULL);
35133513

3514+
// (gth) survive the case where the skeleton for this object no longer has
3515+
// the bone that we're trying to use. This happens when a skeleton is re-exported
3516+
// but the models that depend on it aren't re-exported...
3517+
if (boneindex >= HTree->Num_Pivots()) {
3518+
WWDEBUG_SAY(("ERROR: Model %s tried to use bone %d in skeleton %s. Please re-export!",Get_Name(),boneindex,HTree->Get_Name()));
3519+
boneindex = 0;
3520+
}
3521+
35143522
ModelNodeClass newnode;
35153523
newnode.Model = robj;
35163524
newnode.Model->Add_Ref();

Generals/Code/Libraries/Source/WWVegas/WW3D2/hlod.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
** Command & Conquer Generals(tm)
2+
** Command & Conquer Generals Zero Hour(tm)
33
** Copyright 2025 Electronic Arts Inc.
44
**
55
** This program is free software: you can redistribute it and/or modify

0 commit comments

Comments
 (0)