mirror of
https://github.com/TombEngine/TombEngine.git
synced 2025-04-28 15:57:59 +03:00
Fix crash with old panel objects present in a level
This commit is contained in:
parent
1daf39471a
commit
28773e2387
3 changed files with 8 additions and 2 deletions
|
@ -1014,5 +1014,5 @@ enum GAME_OBJECT_ID : short
|
|||
ID_DIARY_SPRITES,
|
||||
ID_DIARY_ENTRY_SPRITES,
|
||||
|
||||
ID_NUMBER_OBJECTS
|
||||
ID_NUMBER_OBJECTS = 1408 // Compatibility. Remove this constant when slot count is nearing 1408.
|
||||
};
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
#pragma once
|
||||
|
||||
// This file is generated automatically, do not edit it.
|
||||
// Last generated on 11/03/2025.
|
||||
// Last generated on 13/03/2025.
|
||||
|
||||
#include <unordered_map>
|
||||
#include <string>
|
||||
|
|
|
@ -440,6 +440,12 @@ void LoadObjects()
|
|||
int objNum = ReadInt32();
|
||||
MoveablesIds.push_back(objNum);
|
||||
|
||||
if (objNum >= GAME_OBJECT_ID::ID_NUMBER_OBJECTS)
|
||||
{
|
||||
TENLog("Unsupported object slot is detected in a level. Make sure you delete unsupported objects from your wads.", LogLevel::Warning);
|
||||
continue;
|
||||
}
|
||||
|
||||
Objects[objNum].loaded = true;
|
||||
Objects[objNum].nmeshes = ReadInt32();
|
||||
Objects[objNum].meshIndex = ReadInt32();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue