mirror of
https://github.com/ZDoom/gzdoom.git
synced 2024-11-30 15:52:09 +00:00
- fixed: FraggleScript's SpawnedThings array must always be checked for owned inventory items. The 'mapthingnumexist' function forgot to do that.
This commit is contained in:
parent
400a573e65
commit
004cf5748c
1 changed files with 17 additions and 5 deletions
|
@ -3530,9 +3530,18 @@ void FParser::SF_MapThingNumExist()
|
|||
}
|
||||
else
|
||||
{
|
||||
t_return.type = svt_int;
|
||||
// Inventory items in the player's inventory have to be considered non-present.
|
||||
if (SpawnedThings[intval]->IsKindOf(RUNTIME_CLASS(AInventory)) &&
|
||||
barrier_cast<AInventory*>(SpawnedThings[intval])->Owner != NULL)
|
||||
{
|
||||
t_return.value.i = 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
t_return.value.i = 1;
|
||||
}
|
||||
t_return.type = svt_int;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -3770,12 +3779,15 @@ void FParser::SF_ObjType()
|
|||
mo = Script->trigger;
|
||||
}
|
||||
|
||||
if (mo != NULL)
|
||||
{
|
||||
for (unsigned int i = 0; i < countof(ActorTypes); i++) if (mo->GetClass() == ActorTypes[i])
|
||||
{
|
||||
t_return.type = svt_int;
|
||||
t_return.value.i = i;
|
||||
return;
|
||||
}
|
||||
}
|
||||
t_return.type = svt_int;
|
||||
t_return.value.i = -1;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue