mirror of
https://github.com/ZDoom/gzdoom-gles.git
synced 2024-11-28 06:53:40 +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 DestroyPSprites();
|
||||
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.
|
||||
|
|
|
@ -123,9 +123,10 @@ DEFINE_ACTION_FUNCTION(AActor, A_Feathers)
|
|||
|
||||
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