mirror of
https://github.com/ZDoom/qzdoom.git
synced 2024-11-11 07:11:54 +00:00
Fixed crash when morph item is used from ACS
https://forum.zdoom.org/viewtopic.php?t=57571
This commit is contained in:
parent
a6d4bfc748
commit
b077518c89
1 changed files with 6 additions and 4 deletions
|
@ -1843,7 +1843,9 @@ static bool DoUseInv (AActor *actor, PClassActor *info)
|
||||||
AInventory *item = actor->FindInventory (info);
|
AInventory *item = actor->FindInventory (info);
|
||||||
if (item != NULL)
|
if (item != NULL)
|
||||||
{
|
{
|
||||||
if (actor->player == NULL)
|
player_t* const player = actor->player;
|
||||||
|
|
||||||
|
if (nullptr == player)
|
||||||
{
|
{
|
||||||
return actor->UseInventory(item);
|
return actor->UseInventory(item);
|
||||||
}
|
}
|
||||||
|
@ -1853,10 +1855,10 @@ static bool DoUseInv (AActor *actor, PClassActor *info)
|
||||||
bool res;
|
bool res;
|
||||||
|
|
||||||
// Bypass CF_TOTALLYFROZEN
|
// Bypass CF_TOTALLYFROZEN
|
||||||
cheats = actor->player->cheats;
|
cheats = player->cheats;
|
||||||
actor->player->cheats &= ~CF_TOTALLYFROZEN;
|
player->cheats &= ~CF_TOTALLYFROZEN;
|
||||||
res = actor->UseInventory(item);
|
res = actor->UseInventory(item);
|
||||||
actor->player->cheats |= (cheats & CF_TOTALLYFROZEN);
|
player->cheats |= (cheats & CF_TOTALLYFROZEN);
|
||||||
return res;
|
return res;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue