mirror of
https://github.com/ZDoom/qzdoom-gpl.git
synced 2024-11-16 09:11:17 +00:00
- fixed: Checking the terrain for any texture that was created after initializing the terrain data either returned random garbage or could even create an access violation. Added a range check to the array access function to prevent this.
This commit is contained in:
parent
1a39ac9243
commit
a5a17e45cf
1 changed files with 2 additions and 0 deletions
|
@ -49,11 +49,13 @@ public:
|
|||
|
||||
WORD operator [](FTextureID tex) const
|
||||
{
|
||||
if ((unsigned)tex.GetIndex() >= Types.Size()) return DefaultTerrainType;
|
||||
WORD type = Types[tex.GetIndex()];
|
||||
return type == 0xffff? DefaultTerrainType : type;
|
||||
}
|
||||
WORD operator [](int texnum) const
|
||||
{
|
||||
if ((unsigned)texnum >= Types.Size()) return DefaultTerrainType;
|
||||
WORD type = Types[texnum];
|
||||
return type == 0xffff? DefaultTerrainType : type;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue