mirror of
https://github.com/DrBeef/Raze.git
synced 2025-01-18 23:21:43 +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(); }
|
bool targetset() { return target.asbam(); }
|
||||||
|
|
||||||
// Input locking helpers.
|
// Input locking helpers.
|
||||||
void lockinput() { inputdisabled = true; }
|
|
||||||
void unlockinput() { inputdisabled = false; }
|
|
||||||
bool movementlocked() { return targetset() || inputdisabled; }
|
bool movementlocked() { return targetset() || inputdisabled; }
|
||||||
|
|
||||||
// Draw code helpers.
|
// 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())
|
if (!SyncInput())
|
||||||
{
|
{
|
||||||
target = value;
|
target = value;
|
||||||
|
|
|
@ -3119,8 +3119,7 @@ void useTeleportTarget(DBloodActor* sourceactor, DBloodActor* actor)
|
||||||
{
|
{
|
||||||
if (pPlayer)
|
if (pPlayer)
|
||||||
{
|
{
|
||||||
pPlayer->angle.settarget(buildang(sourceactor->spr.ang));
|
pPlayer->angle.settarget(buildang(sourceactor->spr.ang), true);
|
||||||
pPlayer->angle.lockinput();
|
|
||||||
}
|
}
|
||||||
else if (isDude) sourceactor->xspr.goalAng = actor->spr.ang = sourceactor->spr.ang;
|
else if (isDude) sourceactor->xspr.goalAng = actor->spr.ang = sourceactor->spr.ang;
|
||||||
else 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;
|
if (actor->xspr.data4 != 0) break;
|
||||||
else if (actor->spr.flags & kModernTypeFlag1)
|
else if (actor->spr.flags & kModernTypeFlag1)
|
||||||
{
|
{
|
||||||
pPlayer->angle.settarget(buildang(actor->spr.ang));
|
pPlayer->angle.settarget(buildang(actor->spr.ang), true);
|
||||||
pPlayer->angle.lockinput();
|
|
||||||
}
|
}
|
||||||
else if (valueIsBetween(actor->xspr.data2, -kAng360, kAng360))
|
else if (valueIsBetween(actor->xspr.data2, -kAng360, kAng360))
|
||||||
{
|
{
|
||||||
pPlayer->angle.settarget(buildang(actor->xspr.data2));
|
pPlayer->angle.settarget(buildang(actor->xspr.data2), true);
|
||||||
pPlayer->angle.lockinput();
|
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case 10: // 74 (de)activate powerup
|
case 10: // 74 (de)activate powerup
|
||||||
|
|
Loading…
Reference in a new issue