From b40ec07d36c9e051e7a0406a365b4b38cfca6514 Mon Sep 17 00:00:00 2001 From: helixhorned Date: Fri, 18 May 2012 12:46:25 +0000 Subject: [PATCH] Fix cheats giving inventory items and their events. git-svn-id: https://svn.eduke32.com/eduke32@2670 1a8010ca-5511-0410-912e-c29ae57300e0 --- polymer/eduke32/source/game.c | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/polymer/eduke32/source/game.c b/polymer/eduke32/source/game.c index 4cd091583..f3d388835 100644 --- a/polymer/eduke32/source/game.c +++ b/polymer/eduke32/source/game.c @@ -7003,11 +7003,9 @@ enum cheatindex_t static void doinvcheat(int32_t invidx, int32_t defaultnum, int32_t event) { - if (VM_OnEvent(event, g_player[myconnectindex].ps->i, myconnectindex, -1, defaultnum) >= 0) - { - g_player[myconnectindex].ps->inv_amount[invidx] = - aGameVars[g_iReturnVarID].val.lValue; - } + defaultnum = VM_OnEvent(event, g_player[myconnectindex].ps->i, myconnectindex, -1, defaultnum); + if (defaultnum >= 0) + g_player[myconnectindex].ps->inv_amount[invidx] = defaultnum; } static void G_CheatGetInv(void)