diff --git a/Source/Client/Draw.c b/Source/Client/Draw.c index 74e11483..087136a6 100755 --- a/Source/Client/Draw.c +++ b/Source/Client/Draw.c @@ -122,9 +122,8 @@ void CSQC_DrawCenterprint( void ) { vCenterPrintPos_y = vVideoMins_y + ( vVideoResolution_y / 2 ) - ( fCenterPrintLines - 4 ); for ( int i = 0; i < ( fCenterPrintLines ); i++ ) { - vCenterPrintPos_x = vVideoMins_x + ( vVideoResolution_x / 2 ) - ( stringwidth( sCenterPrintBuffer[ i ], FALSE ) / 2 ); - drawstring( vCenterPrintPos + '1 1', sCenterPrintBuffer[ i ], '8 8', '0 0 0', fCenterPrintAlpha, 0 ); - drawstring( vCenterPrintPos, sCenterPrintBuffer[ i ], '8 8', '1 1 1', fCenterPrintAlpha, 0 ); + vCenterPrintPos_x = vVideoMins_x + ( vVideoResolution_x / 2 ) - ( stringwidth( sCenterPrintBuffer[ i ], FALSE, '12 12' ) / 2 ); + drawstring( vCenterPrintPos, sCenterPrintBuffer[ i ], '12 12', '1 1 1', fCenterPrintAlpha, 0 ); vCenterPrintPos_y += 8; } } diff --git a/Source/Server/ArmouryEntity.c b/Source/Server/ArmouryEntity.c index 92fdba4c..f4f37ba2 100755 --- a/Source/Server/ArmouryEntity.c +++ b/Source/Server/ArmouryEntity.c @@ -81,8 +81,9 @@ void armoury_entity( void ) { entity eOld = self; self = other; - - if ( iArmouryItems[ eOld.item ] < 32 ) { + + // Only MP5 til PARA + if ( eOld.item < 14 ) { if ( Weapon_SlotEmpty( Weapon_GetSlot( iArmouryItems[ eOld.item ] ) ) ) { Weapon_AddItem( iArmouryItems[ eOld.item ] ); Weapon_Draw( iArmouryItems[ eOld.item ] ); @@ -92,6 +93,49 @@ void armoury_entity( void ) { } } else { // Equipment + if ( iArmouryItems[ eOld.item ] == EQUIPMENT_KEVLAR ) { + if ( self.armor != 100 ) { + self.armor = 100; + } else { + self = eOld; + return; + } + } else if ( iArmouryItems[ eOld.item ] == EQUIPMENT_HELMET ) { + if ( self.armor == 100 ) { + if ( !( self.iEquipment & EQUIPMENT_HELMET ) ) { + sound( self, CHAN_ITEM, "items/tr_kevlar.wav", 1, ATTN_IDLE ); + } else { + self = eOld; + return; + } + } else { + if ( self.iEquipment & EQUIPMENT_HELMET ) { + self.armor = 100; + sound( self, CHAN_ITEM, "items/tr_kevlar.wav", 1, ATTN_IDLE ); + } else { + self.armor = 100; + self.iEquipment = self.iEquipment | EQUIPMENT_HELMET; + sound( self, CHAN_ITEM, "items/tr_kevlar.wav", 1, ATTN_IDLE ); + } + } + } else { + int iNades = self.iAmmo_FLASHBANG + self.iAmmo_HEGRENADE + self.iAmmo_SMOKEGRENADE; + if ( iNades < 3 ) { + if ( iArmouryItems[ eOld.item ] == WEAPON_FLASHBANG ) { + self.iAmmo_FLASHBANG++; + sound( self, CHAN_ITEM, "items/gunpickup2.wav", 1, ATTN_IDLE ); + } else if ( iArmouryItems[ eOld.item ] == WEAPON_HEGRENADE ) { + self.iAmmo_HEGRENADE++; + sound( self, CHAN_ITEM, "items/gunpickup2.wav", 1, ATTN_IDLE ); + } else if ( iArmouryItems[ eOld.item ] == WEAPON_SMOKEGRENADE ) { + self.iAmmo_SMOKEGRENADE++; + sound( self, CHAN_ITEM, "items/gunpickup2.wav", 1, ATTN_IDLE ); + } + } else { + self = eOld; + return; + } + } } self = eOld; diff --git a/Source/Shared/Weapons.c b/Source/Shared/Weapons.c index 7cabe882..d196f886 100755 --- a/Source/Shared/Weapons.c +++ b/Source/Shared/Weapons.c @@ -259,13 +259,22 @@ Returns whether or not we have the given weapon already ================= */ float Weapon_AlreadyExists( float fWeapon ) { - if ( wptTable[ fWeapon ].iSlot == SLOT_PRIMARY ) { - if ( self.fSlotPrimary == fWeapon ) { + if ( fWeapon == WEAPON_FLASHBANG || fWeapon == WEAPON_HEGRENADE || fWeapon == WEAPON_SMOKEGRENADE ) { + int iNades = self.iAmmo_FLASHBANG + self.iAmmo_HEGRENADE + self.iAmmo_SMOKEGRENADE; + if ( iNades ) { return TRUE; + } else { + return FALSE; } - } else if ( wptTable[ fWeapon ].iSlot == SLOT_SECONDARY ) { - if ( self.fSlotSecondary == fWeapon ) { - return TRUE; + } else { + if ( wptTable[ fWeapon ].iSlot == SLOT_PRIMARY ) { + if ( self.fSlotPrimary == fWeapon ) { + return TRUE; + } + } else if ( wptTable[ fWeapon ].iSlot == SLOT_SECONDARY ) { + if ( self.fSlotSecondary == fWeapon ) { + return TRUE; + } } } @@ -524,7 +533,7 @@ Client-HUD call that switches to a specific weapon ================= */ void CSEv_PlayerSwitchWeapon_f( float fWeapon ) { - if ( Weapon_AlreadyExists( fWeapon ) == FALSE && fWeapon != WEAPON_KNIFE ) { + if ( ( Weapon_AlreadyExists( fWeapon ) == FALSE ) && ( fWeapon != WEAPON_KNIFE ) ) { return; } if ( fWeapon != self.weapon ) { diff --git a/freecs/csprogs.dat b/freecs/csprogs.dat index 87e68b72..626dc589 100755 Binary files a/freecs/csprogs.dat and b/freecs/csprogs.dat differ diff --git a/freecs/progs.dat b/freecs/progs.dat index 5a16a947..8cf34a4a 100755 Binary files a/freecs/progs.dat and b/freecs/progs.dat differ