mirror of
https://github.com/ZDoom/qzdoom.git
synced 2024-11-13 07:57:58 +00:00
Avoid creating the targeter layers if the inventory item isn't attached to
its owner yet
This commit is contained in:
parent
e1f139ddcd
commit
bc334ccc9f
2 changed files with 14 additions and 2 deletions
|
@ -1294,6 +1294,11 @@ void APowerTargeter::Travelled ()
|
||||||
|
|
||||||
void APowerTargeter::InitEffect ()
|
void APowerTargeter::InitEffect ()
|
||||||
{
|
{
|
||||||
|
// Why is this called when the inventory isn't even attached yet
|
||||||
|
// in APowerup::CreateCopy?
|
||||||
|
if (!Owner->FindInventory(GetClass(), true))
|
||||||
|
return;
|
||||||
|
|
||||||
player_t *player;
|
player_t *player;
|
||||||
|
|
||||||
Super::InitEffect();
|
Super::InitEffect();
|
||||||
|
@ -1317,6 +1322,14 @@ void APowerTargeter::InitEffect ()
|
||||||
PositionAccuracy ();
|
PositionAccuracy ();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void APowerTargeter::AttachToOwner(AActor *other)
|
||||||
|
{
|
||||||
|
Super::AttachToOwner(other);
|
||||||
|
|
||||||
|
// Let's actually properly call this for the targeters.
|
||||||
|
InitEffect();
|
||||||
|
}
|
||||||
|
|
||||||
bool APowerTargeter::HandlePickup(AInventory *item)
|
bool APowerTargeter::HandlePickup(AInventory *item)
|
||||||
{
|
{
|
||||||
if (Super::HandlePickup(item))
|
if (Super::HandlePickup(item))
|
||||||
|
@ -1327,8 +1340,6 @@ bool APowerTargeter::HandlePickup(AInventory *item)
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
void APowerTargeter::DoEffect ()
|
void APowerTargeter::DoEffect ()
|
||||||
{
|
{
|
||||||
Super::DoEffect ();
|
Super::DoEffect ();
|
||||||
|
|
|
@ -182,6 +182,7 @@ protected:
|
||||||
void EndEffect ();
|
void EndEffect ();
|
||||||
void PositionAccuracy ();
|
void PositionAccuracy ();
|
||||||
void Travelled ();
|
void Travelled ();
|
||||||
|
void AttachToOwner(AActor *other);
|
||||||
bool HandlePickup(AInventory *item);
|
bool HandlePickup(AInventory *item);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue