mirror of
https://github.com/ZDoom/Raze.git
synced 2024-11-15 08:51:24 +00:00
- Add bool lock
to PlayerAngle::settarget()
when setting target from the ticker without having to call setters and resetters.
This commit is contained in:
parent
18541d1ab4
commit
1ac58dc41c
2 changed files with 6 additions and 9 deletions
|
@ -173,8 +173,6 @@ struct PlayerAngle
|
|||
bool targetset() { return target.asbam(); }
|
||||
|
||||
// Input locking helpers.
|
||||
void lockinput() { inputdisabled = true; }
|
||||
void unlockinput() { inputdisabled = false; }
|
||||
bool movementlocked() { return targetset() || inputdisabled; }
|
||||
|
||||
// Draw code helpers.
|
||||
|
@ -209,8 +207,10 @@ struct PlayerAngle
|
|||
}
|
||||
}
|
||||
|
||||
void settarget(binangle const value)
|
||||
void settarget(binangle const value, bool const lock = false)
|
||||
{
|
||||
inputdisabled = lock;
|
||||
|
||||
if (!SyncInput())
|
||||
{
|
||||
target = value;
|
||||
|
|
|
@ -3119,8 +3119,7 @@ void useTeleportTarget(DBloodActor* sourceactor, DBloodActor* actor)
|
|||
{
|
||||
if (pPlayer)
|
||||
{
|
||||
pPlayer->angle.settarget(buildang(sourceactor->spr.ang));
|
||||
pPlayer->angle.lockinput();
|
||||
pPlayer->angle.settarget(buildang(sourceactor->spr.ang), true);
|
||||
}
|
||||
else if (isDude) sourceactor->xspr.goalAng = actor->spr.ang = sourceactor->spr.ang;
|
||||
else actor->spr.ang = sourceactor->spr.ang;
|
||||
|
@ -5841,13 +5840,11 @@ bool modernTypeOperateSprite(DBloodActor* actor, EVENT& event)
|
|||
if (actor->xspr.data4 != 0) break;
|
||||
else if (actor->spr.flags & kModernTypeFlag1)
|
||||
{
|
||||
pPlayer->angle.settarget(buildang(actor->spr.ang));
|
||||
pPlayer->angle.lockinput();
|
||||
pPlayer->angle.settarget(buildang(actor->spr.ang), true);
|
||||
}
|
||||
else if (valueIsBetween(actor->xspr.data2, -kAng360, kAng360))
|
||||
{
|
||||
pPlayer->angle.settarget(buildang(actor->xspr.data2));
|
||||
pPlayer->angle.lockinput();
|
||||
pPlayer->angle.settarget(buildang(actor->xspr.data2), true);
|
||||
}
|
||||
break;
|
||||
case 10: // 74 (de)activate powerup
|
||||
|
|
Loading…
Reference in a new issue