mirror of
https://github.com/ZDoom/Raze.git
synced 2025-03-13 04:24:39 +00:00
- Duke: Move PlayerUseItem()
wrapper into DDukePlayer
.
This commit is contained in:
parent
ab47cf185e
commit
cd755a8336
3 changed files with 7 additions and 8 deletions
|
@ -105,12 +105,6 @@ inline bool isIn(int value, const std::initializer_list<int>& list)
|
|||
return false;
|
||||
}
|
||||
|
||||
// these are mainly here to avoid directly accessing the input data so that it can be more easily refactored later.
|
||||
inline void PlayerSetItemUsed(int pl, int num)
|
||||
{
|
||||
getPlayer(pl)->cmd.ucmd.setItemUsed(num - 1);
|
||||
}
|
||||
|
||||
inline void clearfriction()
|
||||
{
|
||||
for (int i = 0; i != -1; i = connectpoint2[i])
|
||||
|
|
|
@ -123,9 +123,9 @@ void hud_input(int plnum)
|
|||
{
|
||||
SetGameVarID(g_iReturnVarID, 0, nullptr, plnum);
|
||||
OnEvent(EVENT_INVENTORY, plnum, nullptr, -1);
|
||||
if (GetGameVarID(g_iReturnVarID, nullptr, plnum).value() == 0)
|
||||
if (GetGameVarID(g_iReturnVarID, nullptr, plnum).value() == 0 && p->inven_icon > ICON_NONE && p->inven_icon <= ICON_HEATS)
|
||||
{
|
||||
if (p->inven_icon > ICON_NONE && p->inven_icon <= ICON_HEATS) PlayerSetItemUsed(plnum, p->inven_icon);
|
||||
p->useItem(p->inven_icon);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -404,6 +404,11 @@ public:
|
|||
{
|
||||
return cmd.ucmd.isItemUsed(num - 1);
|
||||
}
|
||||
|
||||
inline void useItem(int num)
|
||||
{
|
||||
cmd.ucmd.setItemUsed(num - 1);
|
||||
}
|
||||
};
|
||||
|
||||
struct Cycler
|
||||
|
|
Loading…
Reference in a new issue