- fixed Dehacked drop items.

This commit is contained in:
Christoph Oelckers 2022-04-15 23:10:53 +02:00
parent 446a24d095
commit bdab9c2d9d

View file

@ -1260,15 +1260,21 @@ static int PatchThing (int thingy)
}
else if (linelen == 12 && stricmp(Line1, "dropped item") == 0)
{
val--; // This is 1-based and 0 means 'no drop'.
if ((unsigned)val < InfoNames.Size())
{
FDropItem* di = (FDropItem*)ClassDataAllocator.Alloc(sizeof(FDropItem));
di->Next = nullptr;
di->Name = InfoNames[val]->TypeName.GetChars();
di->Probability = 255;
di->Amount = -1;
info->GetInfo()->DropItems = di;
}
else if (val == -1)
{
info->GetInfo()->DropItems = nullptr;
}
}
else if (linelen == 11 && stricmp(Line1, "blood color") == 0)
{