mirror of
https://github.com/ZDoom/Raze.git
synced 2025-02-01 04:40:46 +00:00
- Duke: Move PlayerUseItem()
wrapper into DDukePlayer
.
* Regex used: `PlayerUseItem\(\w+\,\s?(\w+)\)` -> `p->itemUsed($1)`.
This commit is contained in:
parent
0d25bbe84a
commit
ab47cf185e
3 changed files with 11 additions and 11 deletions
|
@ -111,11 +111,6 @@ inline void PlayerSetItemUsed(int pl, int num)
|
|||
getPlayer(pl)->cmd.ucmd.setItemUsed(num - 1);
|
||||
}
|
||||
|
||||
inline bool PlayerUseItem(int pl, int num)
|
||||
{
|
||||
return getPlayer(pl)->cmd.ucmd.isItemUsed(num - 1);
|
||||
}
|
||||
|
||||
inline void clearfriction()
|
||||
{
|
||||
for (int i = 0; i != -1; i = connectpoint2[i])
|
||||
|
|
|
@ -129,7 +129,7 @@ void hud_input(int plnum)
|
|||
}
|
||||
}
|
||||
|
||||
if (!isRR() && PlayerUseItem(plnum, ICON_HEATS))
|
||||
if (!isRR() && p->itemUsed(ICON_HEATS))
|
||||
{
|
||||
SetGameVarID(g_iReturnVarID, 0, nullptr, plnum);
|
||||
OnEvent(EVENT_USENIGHTVISION, plnum, nullptr, -1);
|
||||
|
@ -142,7 +142,7 @@ void hud_input(int plnum)
|
|||
}
|
||||
}
|
||||
|
||||
if (PlayerUseItem(plnum, ICON_STEROIDS))
|
||||
if (p->itemUsed(ICON_STEROIDS))
|
||||
{
|
||||
SetGameVarID(g_iReturnVarID, 0, nullptr, plnum);
|
||||
OnEvent(EVENT_USESTEROIDS, plnum, nullptr, -1);
|
||||
|
@ -269,7 +269,7 @@ void hud_input(int plnum)
|
|||
}
|
||||
}
|
||||
|
||||
if (PlayerUseItem(plnum, ICON_HOLODUKE) && (isRR() || p->newOwner == nullptr))
|
||||
if (p->itemUsed(ICON_HOLODUKE) && (isRR() || p->newOwner == nullptr))
|
||||
{
|
||||
SetGameVarID(g_iReturnVarID, 0, nullptr, plnum);
|
||||
OnEvent(EVENT_HOLODUKEON, plnum, nullptr, -1);
|
||||
|
@ -323,7 +323,7 @@ void hud_input(int plnum)
|
|||
}
|
||||
}
|
||||
|
||||
if (isRR() && PlayerUseItem(plnum, ICON_HEATS) && p->newOwner == nullptr)
|
||||
if (isRR() && p->itemUsed(ICON_HEATS) && p->newOwner == nullptr)
|
||||
{
|
||||
SetGameVarID(g_iReturnVarID, 0, nullptr, plnum);
|
||||
OnEvent(EVENT_USENIGHTVISION, plnum, nullptr, -1);
|
||||
|
@ -355,7 +355,7 @@ void hud_input(int plnum)
|
|||
}
|
||||
}
|
||||
|
||||
if (PlayerUseItem(plnum, ICON_FIRSTAID))
|
||||
if (p->itemUsed(ICON_FIRSTAID))
|
||||
{
|
||||
SetGameVarID(g_iReturnVarID, 0, nullptr, plnum);
|
||||
OnEvent(EVENT_USEMEDKIT, plnum, nullptr, -1);
|
||||
|
@ -408,7 +408,7 @@ void hud_input(int plnum)
|
|||
}
|
||||
}
|
||||
|
||||
if (PlayerUseItem(plnum, ICON_JETPACK) && (isRR() || p->newOwner == nullptr))
|
||||
if (p->itemUsed(ICON_JETPACK) && (isRR() || p->newOwner == nullptr))
|
||||
{
|
||||
SetGameVarID(g_iReturnVarID, 0, nullptr, plnum);
|
||||
OnEvent(EVENT_USEJETPACK, plnum, nullptr, -1);
|
||||
|
|
|
@ -399,6 +399,11 @@ public:
|
|||
{
|
||||
Angles.doViewPitch(aim_mode == 0 && on_ground && cursector->lotag != ST_2_UNDERWATER);
|
||||
}
|
||||
|
||||
inline bool itemUsed(int num)
|
||||
{
|
||||
return cmd.ucmd.isItemUsed(num - 1);
|
||||
}
|
||||
};
|
||||
|
||||
struct Cycler
|
||||
|
|
Loading…
Reference in a new issue