Added a hostname field to the menu

Fixed that a dropped C4 Bomb could not be picked up again
This commit is contained in:
Marco Cawthorne 2017-11-17 15:45:48 -06:00
parent 251d8908b2
commit 794b08d64c
7 changed files with 38 additions and 5 deletions

View file

@ -61,7 +61,7 @@
<localfile path="C:\cygwin\home\User\FreeCS\Source\Server\TraceAttack.c" />
<localfile path="C:\cygwin\home\User\FreeCS\Source\Server\Triggers.c" />
</category>
<category name="Menu" expanded="no">
<category name="Menu" expanded="yes">
<localfile path="C:\cygwin\home\User\FreeCS\Source\Menu\Defs.h" />
<localfile path="C:\cygwin\home\User\FreeCS\Source\Menu\Draw.c" />
<localfile path="C:\cygwin\home\User\FreeCS\Source\Menu\Header.c" />
@ -83,7 +83,6 @@
<localfile path="C:\cygwin\home\User\FreeCS\Source\Shared\WeaponAK47.c" />
<localfile path="C:\cygwin\home\User\FreeCS\Source\Shared\WeaponAUG.c" />
<localfile path="C:\cygwin\home\User\FreeCS\Source\Shared\WeaponAWP.c" />
<localfile path="C:\cygwin\home\User\FreeCS\Source\Shared\WeaponBase.c" />
<localfile path="C:\cygwin\home\User\FreeCS\Source\Shared\WeaponC4Bomb.c" />
<localfile path="C:\cygwin\home\User\FreeCS\Source\Shared\WeaponDeagle.c" />
<localfile path="C:\cygwin\home\User\FreeCS\Source\Shared\WeaponElites.c" />

View file

@ -189,6 +189,8 @@ Server creation menu screen
void Menu_Multiplayer_Create( void ) {
static int iSelectedMap;
static int iScrollMap;
static int iFirst = 1;
static string strHostname;
static void Create_ListMap( vector vPosition, int iIndex ) {
float fAlpha = 0.8;
@ -216,6 +218,13 @@ void Menu_Multiplayer_Create( void ) {
iMenu = MENU_MULTIPLAYER_OPTIONS;
}
static void Create_ButtonOK( void ) {
// Apply the configurations
if ( strHostname != __NULL__ ) {
localcmd( sprintf( "hostname %s\n", strHostname ) );
} else {
strHostname = cvar_string( "hostname" );
}
// Start server
localcmd( sprintf( "map %s\n", sMapList[ iSelectedMap ] ) );
}
@ -223,10 +232,20 @@ void Menu_Multiplayer_Create( void ) {
iMenu = MENU_MULTIPLAYER;
}
if ( iFirst == 1 ) {
strHostname = cvar_string( "hostname" );
iFirst = 0;
}
Object_Button( '32 148', BTN_ADVOPTIONS, Create_ButtonAdvanced, fButtonAlpha[0] );
Object_Button( '32 180', BTN_OK, Create_ButtonOK, fButtonAlpha[1] );
Object_Button( '32 212', BTN_CANCEL, Create_ButtonCancel, fButtonAlpha[2] );
// Options
Object_Label( '196 148', _("SERVER_NAME"), '8 8' );
Object_Textfield( '196 160', strHostname, 20 );
// Map list
Object_Label( '384 148', _("MP_MAPS"), '8 8' );
Object_Frame( '384 164', '190 288' );
Object_Scrollbar( '576 164', 288, iScrollMap );

View file

@ -287,6 +287,10 @@ float Weapon_SlotEmpty( int fSlot ) {
if ( self.fSlotSecondary == 0 ) {
return TRUE;
}
} else if ( fSlot == SLOT_GRENADE ) {
if ( self.fSlotGrenade == 0 ) {
return TRUE;
}
}
return FALSE;
@ -402,9 +406,14 @@ void Weapon_DropWeapon( int iSlot ) {
return;
}
// No bomb for the CTs
if ( ( self.weapon == WEAPON_C4BOMB ) && ( other.team == TEAM_CT ) ) {
return;
}
entity eOld = self;
self = other;
if ( Weapon_SlotEmpty( Weapon_GetSlot( eOld.weapon ) ) ) {
Weapon_AddItem( eOld.weapon );
Weapon_Draw( eOld.weapon );

Binary file not shown.

View file

@ -48,4 +48,7 @@ msgid "PLAYER_GUICOLOR"
msgstr "UI Farbe:"
msgid "PLAYER_HUDCOLOR"
msgstr "Heads-Up-Display Farbe:"
msgstr "Heads-Up-Display Farbe:"
msgid "SERVER_NAME"
msgstr "Servername:"

View file

@ -54,4 +54,7 @@ msgid "PLAYER_GUICOLOR"
msgstr "UI Color:"
msgid "PLAYER_HUDCOLOR"
msgstr "Heads-Up-Display Color:"
msgstr "Heads-Up-Display Color:"
msgid "SERVER_NAME"
msgstr "Hostname:"

Binary file not shown.