mirror of
https://github.com/ZDoom/gzdoom.git
synced 2025-02-06 16:41:44 +00:00
fix automap display for keys that were altered by Dehacked.
This commit is contained in:
parent
a1460e88af
commit
7b30f9350c
2 changed files with 18 additions and 1 deletions
|
@ -2910,11 +2910,18 @@ void DAutomap::drawKeys ()
|
|||
mpoint_t p;
|
||||
DAngle angle;
|
||||
|
||||
auto it = Level->GetThinkerIterator<AActor>(NAME_Key);
|
||||
auto it = Level->GetThinkerIterator<AActor>(NAME_Inventory);
|
||||
AActor *key;
|
||||
|
||||
while ((key = it.Next()) != nullptr)
|
||||
{
|
||||
auto cls = key->GetClass();
|
||||
if (cls->IsDescendantOf(NAME_DehackedPickup))
|
||||
{
|
||||
cls = cls->ActorInfo()->Replacee;
|
||||
}
|
||||
if (!cls->IsDescendantOf(NAME_Key)) continue;
|
||||
|
||||
DVector3 pos = key->PosRelative(MapPortalGroup);
|
||||
p.x = pos.X;
|
||||
p.y = pos.Y;
|
||||
|
|
|
@ -62,6 +62,16 @@ struct OneKey
|
|||
// P_GetMapColorForKey() checks the key directly
|
||||
if (owner->IsA(key) || owner->GetSpecies() == key->TypeName) return true;
|
||||
|
||||
if (owner->IsKindOf(NAME_DehackedPickup))
|
||||
{
|
||||
auto cls = owner->GetClass()->ActorInfo()->Replacee;
|
||||
if (cls == key || owner->Species == key->TypeName)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// Other calls check an actor that may have a key in its inventory.
|
||||
for (AActor *item = owner->Inventory; item != NULL; item = item->Inventory)
|
||||
{
|
||||
|
|
Loading…
Reference in a new issue