From ba4630f0df038110a4a424900bca6734b2de9f5c Mon Sep 17 00:00:00 2001 From: Braden Obrzut Date: Sat, 13 Aug 2011 20:30:59 +0000 Subject: [PATCH] - Added ammo1capacity and ammo2capacity to drawnumber. SVN r3277 (trunk) --- src/g_shared/sbarinfo_commands.cpp | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/src/g_shared/sbarinfo_commands.cpp b/src/g_shared/sbarinfo_commands.cpp index f31a5f77b..8b62359f9 100644 --- a/src/g_shared/sbarinfo_commands.cpp +++ b/src/g_shared/sbarinfo_commands.cpp @@ -890,6 +890,10 @@ class CommandDrawNumber : public CommandDrawString value = AMMO1; else if(sc.Compare("ammo2")) value = AMMO2; + else if(sc.Compare("ammo1capacity")) + value = AMMO1CAPACITY; + else if(sc.Compare("ammo2capacity")) + value = AMMO2CAPACITY; else if(sc.Compare("score")) value = SCORE; else if(sc.Compare("ammo")) //request the next string to be an ammo type @@ -1124,6 +1128,24 @@ class CommandDrawNumber : public CommandDrawString num = 0; break; } + case AMMO1CAPACITY: + if(statusBar->ammo1 == NULL) //no ammo, do not draw + { + str = ""; + return; + } + else + num = statusBar->ammo1->MaxAmount; + break; + case AMMO2CAPACITY: + if(statusBar->ammo2 == NULL) //no ammo, do not draw + { + str = ""; + return; + } + else + num = statusBar->ammo2->MaxAmount; + break; case AMMOCAPACITY: { AInventory* item = statusBar->CPlayer->mo->FindInventory(inventoryItem); @@ -1283,6 +1305,8 @@ class CommandDrawNumber : public CommandDrawString AMMO1, AMMO2, AMMO, + AMMO1CAPACITY, + AMMO2CAPACITY, AMMOCAPACITY, FRAGS, INVENTORY,