mirror of
https://github.com/ZDoom/gzdoom.git
synced 2024-11-22 20:21:26 +00:00
- Fixed: The Boss Brain could crash when it tried to shoot a cube but having no spawn spots placed.
SVN r1331 (trunk)
This commit is contained in:
parent
120233eebd
commit
a66eb7f8c3
2 changed files with 19 additions and 1 deletions
|
@ -129,7 +129,7 @@ struct FSpotList
|
|||
|
||||
ASpecialSpot *GetNextInList(int skipcounter)
|
||||
{
|
||||
if (++SkipCount > skipcounter)
|
||||
if (Spots.Size() > 0 && ++SkipCount > skipcounter)
|
||||
{
|
||||
SkipCount = 0;
|
||||
|
||||
|
|
18
src/tarray.h
18
src/tarray.h
|
@ -149,6 +149,24 @@ public:
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
void Delete (unsigned int index, int deletecount)
|
||||
{
|
||||
if (index + deletecount > Count) deletecount = Count - index;
|
||||
if (deletecount > 0)
|
||||
{
|
||||
for(int i = 0; i < deletecount; i++)
|
||||
{
|
||||
Array[index + i].~T();
|
||||
}
|
||||
Count -= deletecount;
|
||||
if (index < Count)
|
||||
{
|
||||
memmove (&Array[index], &Array[index+deletecount], sizeof(T)*(Count - index));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Inserts an item into the array, shifting elements as needed
|
||||
void Insert (unsigned int index, const T &item)
|
||||
{
|
||||
|
|
Loading…
Reference in a new issue