From bb2efe03e31ea5081b8da4b7109c3bfc255e4305 Mon Sep 17 00:00:00 2001 From: Juliano Leal Goncalves Date: Sat, 3 Apr 2021 18:31:42 -0300 Subject: [PATCH] :recycle: Use 'PlayerStruct' references in 'ReleaseChrBtns' function --- Source/control.cpp | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/Source/control.cpp b/Source/control.cpp index bc933a306..d8038f618 100644 --- a/Source/control.cpp +++ b/Source/control.cpp @@ -1667,23 +1667,24 @@ void ReleaseChrBtns(bool addAllStatPoints) && MouseX <= ChrBtnsRect[i].x + ChrBtnsRect[i].w && MouseY >= ChrBtnsRect[i].y && MouseY <= ChrBtnsRect[i].y + ChrBtnsRect[i].h) { - int statPointsToAdd = addAllStatPoints ? plr[myplr]._pStatPts : 1; + PlayerStruct &player = plr[myplr]; + int statPointsToAdd = addAllStatPoints ? player._pStatPts : 1; switch (i) { case 0: NetSendCmdParam1(TRUE, CMD_ADDSTR, statPointsToAdd); - plr[myplr]._pStatPts -= statPointsToAdd; + player._pStatPts -= statPointsToAdd; break; case 1: NetSendCmdParam1(TRUE, CMD_ADDMAG, statPointsToAdd); - plr[myplr]._pStatPts -= statPointsToAdd; + player._pStatPts -= statPointsToAdd; break; case 2: NetSendCmdParam1(TRUE, CMD_ADDDEX, statPointsToAdd); - plr[myplr]._pStatPts -= statPointsToAdd; + player._pStatPts -= statPointsToAdd; break; case 3: NetSendCmdParam1(TRUE, CMD_ADDVIT, statPointsToAdd); - plr[myplr]._pStatPts -= statPointsToAdd; + player._pStatPts -= statPointsToAdd; break; } }