track previous weapon

git-svn-id: svn://svn.code.sf.net/p/actiongame/code/trunk/ac@2460 e016b1c5-ed68-44aa-a2f7-31cac88cffde
This commit is contained in:
Lee Salzman
2008-08-31 18:16:28 +00:00
parent 2ec499585d
commit bd17e8b855
3 changed files with 12 additions and 5 deletions
+6 -1
View File
@@ -24,7 +24,10 @@ void checkweaponswitch()
addmsg(SV_WEAPCHANGE, "ri", player1->weaponsel->type);
player1->weaponchanging = 0;
}
else if(timeprogress>weapon::weaponchangetime/2) player1->weaponsel = player1->nextweaponsel;
else if(timeprogress>weapon::weaponchangetime/2)
{
player1->weaponsel = player1->nextweaponsel;
}
}
void selectweapon(weapon *w)
@@ -94,6 +97,7 @@ void shiftweapon(int s)
}
int currentprimary() { return player1->primweap->type; }
int prevweapon() { return player1->prevweaponsel->type; }
int curweapon() { return player1->weaponsel->type; }
int magcontent(int w) { if(w > 0 && w < NUMGUNS) return player1->weapons[w]->mag; else return -1;}
@@ -102,6 +106,7 @@ int magreserve(int w) { if(w > 0 && w < NUMGUNS) return player1->weapons[w]->amm
COMMANDN(weapon, selectweaponi, ARG_1INT);
COMMAND(shiftweapon, ARG_1INT);
COMMAND(currentprimary, ARG_IVAL);
COMMAND(prevweapon, ARG_IVAL);
COMMAND(curweapon, ARG_IVAL);
COMMAND(magcontent, ARG_1EXP);
COMMAND(magreserve, ARG_1EXP);