Skip to content

Commit

Permalink
- put in some null checks
Browse files Browse the repository at this point in the history
  • Loading branch information
madame-rachelle committed Jul 31, 2019
1 parent edeea71 commit 106c26b
Showing 1 changed file with 11 additions and 8 deletions.
19 changes: 11 additions & 8 deletions zs/flipper.zsc
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ class FlipperInventory : CustomInventory
if (CVar.FindCVar("cheat_turnitoff").GetInt() != 0)
{
// turn it off!
if (runOnce)
if (Owner && runOnce)
{
playerpawn(Owner).SideMove1 = playerpawn(Owner).default.SideMove1;
playerpawn(Owner).SideMove2 = playerpawn(Owner).default.SideMove2;
Expand All @@ -86,17 +86,20 @@ class FlipperInventory : CustomInventory
{
if (!runOnce)
{
oldangle = owner.angle;
runOnce = true;
if (playerpawn(Owner)) {
playerpawn(Owner).SideMove1 = playerpawn(Owner).default.SideMove1 * -1;
playerpawn(Owner).SideMove2 = playerpawn(Owner).default.SideMove2 * -1;
if (Owner)
{
oldangle = Owner.angle;
runOnce = true;
if (playerpawn(Owner)) {
playerpawn(Owner).SideMove1 = playerpawn(Owner).default.SideMove1 * -1;
playerpawn(Owner).SideMove2 = playerpawn(Owner).default.SideMove2 * -1;
}
}
}
else
{
Owner.A_SetAngle(oldangle * 2 - owner.angle, SPF_INTERPOLATE);
oldangle = owner.angle;
Owner.A_SetAngle(oldangle * 2 - Owner.angle, SPF_INTERPOLATE);
oldangle = Owner.angle;
}
}
Super.Tick();
Expand Down

0 comments on commit 106c26b

Please sign in to comment.