From ab21d4463da47a515ca89a87d24d4f7882f81f06 Mon Sep 17 00:00:00 2001 From: Lee Salzman Date: Sun, 12 Nov 2006 23:30:40 +0000 Subject: [PATCH] *** empty log message *** git-svn-id: svn://svn.code.sf.net/p/actiongame/code/trunk/ac@631 e016b1c5-ed68-44aa-a2f7-31cac88cffde --- source/src/entities.cpp | 19 ++++++++++++++----- 1 file changed, 14 insertions(+), 5 deletions(-) diff --git a/source/src/entities.cpp b/source/src/entities.cpp index 2d41c463..73e0b742 100644 --- a/source/src/entities.cpp +++ b/source/src/entities.cpp @@ -274,7 +274,8 @@ void equip(playerent *d) if(m_pistol) // pistol only mode { - d->ammo[GUN_PISTOL] = itemstats[GUN_PISTOL].max; + d->ammo[GUN_PISTOL] = itemstats[GUN_PISTOL].max-magsize(GUN_PISTOL); + d->mag[GUN_PISTOL] = magsize(GUN_PISTOL); } else if(m_lss) { @@ -298,11 +299,19 @@ void equip(playerent *d) void item(int num) { - if (num>0 && num<7) player1->nextprimary = num; + switch(num) + { + case GUN_SHOTGUN: + case GUN_SUBGUN: + case GUN_SNIPER: + case GUN_ASSAULT: + player1->nextprimary = num; + break; - //if (num==6) conoutf("sorry, no nades yet"); - - if (num==7) { player1->hasarmour=!player1->hasarmour; /*toggle armour*/ }; + default: + conoutf("sorry, you can't use that item yet"); + break; + }; }; COMMAND(item,ARG_1INT);