mirror of
https://github.com/ZDoom/gzdoom.git
synced 2024-11-10 23:01:50 +00:00
Fixed a crash with heretic's ChickenPlayer class
This commit is contained in:
parent
05d1df3571
commit
5c182c7fd7
2 changed files with 7 additions and 3 deletions
|
@ -532,7 +532,10 @@ public:
|
||||||
void TickPSprites();
|
void TickPSprites();
|
||||||
void DestroyPSprites();
|
void DestroyPSprites();
|
||||||
DPSprite *FindPSprite(int layer);
|
DPSprite *FindPSprite(int layer);
|
||||||
DPSprite *GetPSprite(PSPLayers layer); // Used ONLY for compatibility with the old hardcoded layers.
|
// Used ONLY for compatibility with the old hardcoded layers.
|
||||||
|
// Make sure that a state is properly set after calling this unless
|
||||||
|
// you are 100% sure the context already implies the layer exists.
|
||||||
|
DPSprite *GetPSprite(PSPLayers layer);
|
||||||
};
|
};
|
||||||
|
|
||||||
// Bookkeeping on players - state.
|
// Bookkeeping on players - state.
|
||||||
|
|
|
@ -123,9 +123,10 @@ DEFINE_ACTION_FUNCTION(AActor, A_Feathers)
|
||||||
|
|
||||||
void P_UpdateBeak (AActor *self)
|
void P_UpdateBeak (AActor *self)
|
||||||
{
|
{
|
||||||
if (self->player != nullptr)
|
DPSprite *pspr;
|
||||||
|
if (self->player != nullptr && (pspr = self->player->FindPSprite(PSP_WEAPON)) != nullptr)
|
||||||
{
|
{
|
||||||
self->player->GetPSprite(PSP_WEAPON)->y = WEAPONTOP + self->player->chickenPeck / 2;
|
pspr->y = WEAPONTOP + self->player->chickenPeck / 2;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue