mirror of
https://github.com/TombEngine/TombEngine.git
synced 2025-04-28 07:47:57 +03:00
Added safeguards for problems surfaced in #1618
This commit is contained in:
parent
dfa8170597
commit
64a2d60d2f
2 changed files with 10 additions and 0 deletions
|
@ -711,6 +711,10 @@ Vector3i GetJointPosition(const ItemInfo& item, const CreatureBiteInfo& bite)
|
|||
Vector3 GetJointOffset(GAME_OBJECT_ID objectID, int jointIndex)
|
||||
{
|
||||
const auto& object = Objects[objectID];
|
||||
int boneIndex = object.boneIndex + (jointIndex * 4);
|
||||
|
||||
if (g_Level.Bones.size() <= boneIndex)
|
||||
return Vector3::Zero;
|
||||
|
||||
int* bonePtr = &g_Level.Bones[object.boneIndex + (jointIndex * 4)];
|
||||
return Vector3(*(bonePtr + 1), *(bonePtr + 2), *(bonePtr + 3));
|
||||
|
|
|
@ -2571,6 +2571,12 @@ namespace TEN::Renderer
|
|||
if (!SetupBlendModeAndAlphaTest(bucket.BlendMode, rendererPass, p))
|
||||
continue;
|
||||
|
||||
if (_staticTextures.size() <= bucket.Texture)
|
||||
{
|
||||
TENLog("Attempted to set incorrect static mesh texture atlas", LogLevel::Warning);
|
||||
continue;
|
||||
}
|
||||
|
||||
BindTexture(TextureRegister::ColorMap,
|
||||
&std::get<0>(_staticTextures[bucket.Texture]),
|
||||
SamplerStateRegister::AnisotropicClamp);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue