From 7210cc8730eecc228894d46720bde671a83aff1e Mon Sep 17 00:00:00 2001 From: Andrey Akhmichin Date: Sun, 17 May 2020 09:15:38 +0500 Subject: [PATCH] Fix weapons. --- cl_dll/Android.mk | 2 +- cl_dll/ammo.cpp | 18 +++++++++--------- dlls/Android.mk | 2 +- dlls/CMakeLists.txt | 2 -- dlls/crowbar.cpp | 4 ++-- dlls/glock.cpp | 2 +- dlls/mp5.cpp | 2 +- dlls/noffice/holster.cpp | 2 +- dlls/noffice/torch.cpp | 4 ++-- dlls/shotgun.cpp | 2 +- dlls/weapons.cpp | 4 ---- 11 files changed, 19 insertions(+), 25 deletions(-) diff --git a/cl_dll/Android.mk b/cl_dll/Android.mk index 9f2ac25d..5b6691e2 100755 --- a/cl_dll/Android.mk +++ b/cl_dll/Android.mk @@ -97,7 +97,7 @@ SRCS+=./input_xash3d.cpp SRCS+=./scoreboard.cpp SRCS+=./MOTD.cpp INCLUDES = -I../common -I. -I../game_shared -I../pm_shared -I../engine -I../dlls -I../utils/false_vgui/include -DEFINES = -Wno-write-strings -DLINUX -D_LINUX -Dstricmp=strcasecmp -Dstrnicmp=strncasecmp -DCLIENT_WEAPONS -DCLIENT_DLL -w -D_snprintf=snprintf +DEFINES = -Wno-write-strings -DLINUX -D_LINUX -Dstricmp=strcasecmp -Dstrnicmp=strncasecmp -DCLIENT_DLL -w -D_snprintf=snprintf LOCAL_C_INCLUDES := $(LOCAL_PATH)/. \ $(LOCAL_PATH)/../common \ diff --git a/cl_dll/ammo.cpp b/cl_dll/ammo.cpp index 818073a0..890cffdd 100644 --- a/cl_dll/ammo.cpp +++ b/cl_dll/ammo.cpp @@ -267,15 +267,15 @@ int CHudAmmo::Init( void ) HOOK_MESSAGE( AmmoX ); HOOK_COMMAND( "slot1", Slot1 ); - HOOK_COMMAND( "slot2", Slot1 ); - HOOK_COMMAND( "slot3", Slot1 ); - HOOK_COMMAND( "slot4", Slot1 ); - HOOK_COMMAND( "slot5", Slot1 ); - HOOK_COMMAND( "slot6", Slot1 ); - HOOK_COMMAND( "slot7", Slot1 ); - HOOK_COMMAND( "slot8", Slot1 ); - HOOK_COMMAND( "slot9", Slot1 ); - HOOK_COMMAND( "slot10", Slot1 ); + HOOK_COMMAND( "slot2", Slot2 ); + HOOK_COMMAND( "slot3", Slot3 ); + HOOK_COMMAND( "slot4", Slot4 ); + HOOK_COMMAND( "slot5", Slot5 ); + HOOK_COMMAND( "slot6", Slot6 ); + HOOK_COMMAND( "slot7", Slot7 ); + HOOK_COMMAND( "slot8", Slot8 ); + HOOK_COMMAND( "slot9", Slot9 ); + HOOK_COMMAND( "slot10", Slot10 ); HOOK_COMMAND( "cancelselect", Close ); HOOK_COMMAND( "invnext", NextWeapon ); HOOK_COMMAND( "invprev", PrevWeapon ); diff --git a/dlls/Android.mk b/dlls/Android.mk index 4511133c..bf6f0f00 100644 --- a/dlls/Android.mk +++ b/dlls/Android.mk @@ -13,7 +13,7 @@ ifeq ($(TARGET_ARCH_ABI),armeabi-v7a-hard) LOCAL_MODULE_FILENAME = libserver_hardfp endif -LOCAL_CFLAGS += -D_LINUX -DCLIENT_WEAPONS -Dstricmp=strcasecmp -Dstrnicmp=strncasecmp -D_snprintf=snprintf \ +LOCAL_CFLAGS += -D_LINUX -Dstricmp=strcasecmp -Dstrnicmp=strncasecmp -D_snprintf=snprintf \ -fno-exceptions -DNO_VOICEGAMEMGR -w LOCAL_CPPFLAGS := $(LOCAL_CFLAGS) diff --git a/dlls/CMakeLists.txt b/dlls/CMakeLists.txt index a54f1c16..aa71d23f 100644 --- a/dlls/CMakeLists.txt +++ b/dlls/CMakeLists.txt @@ -31,8 +31,6 @@ if(HAVE_TGMATH_H) add_definitions(-DHAVE_TGMATH_H) endif() -add_definitions(-DCLIENT_WEAPONS) - if(NOT MSVC) add_compile_options(-fno-exceptions) # GCC/Clang flag add_compile_options(-Wno-invalid-offsetof) # GCC/Clang flag diff --git a/dlls/crowbar.cpp b/dlls/crowbar.cpp index 272fa311..707398a3 100644 --- a/dlls/crowbar.cpp +++ b/dlls/crowbar.cpp @@ -72,7 +72,7 @@ int CCrowbar::GetItemInfo( ItemInfo *p ) p->iMaxAmmo2 = -1; p->iMaxClip = WEAPON_NOCLIP; p->iSlot = 0; - p->iPosition = 2; + p->iPosition = 3; p->iId = WEAPON_CROWBAR; p->iWeight = CROWBAR_WEIGHT; return 1; @@ -203,7 +203,7 @@ int CCrowbar::Swing( int fFirst ) if( tr.flFraction >= 1.0f ) { - if( fFirst ) + // if( fFirst ) { // miss SendWeaponAnim( CROWBAR_RELEASEMISS ); diff --git a/dlls/glock.cpp b/dlls/glock.cpp index 9def2d1c..683b9b6f 100644 --- a/dlls/glock.cpp +++ b/dlls/glock.cpp @@ -79,7 +79,7 @@ int CGlock::GetItemInfo( ItemInfo *p ) p->iMaxAmmo2 = -1; p->iMaxClip = GLOCK_MAX_CLIP; p->iSlot = 0; - p->iPosition = 3; + p->iPosition = 4; p->iFlags = 0; p->iId = m_iId = WEAPON_GLOCK; p->iWeight = GLOCK_WEIGHT; diff --git a/dlls/mp5.cpp b/dlls/mp5.cpp index 6b1b3186..47477f81 100644 --- a/dlls/mp5.cpp +++ b/dlls/mp5.cpp @@ -103,7 +103,7 @@ int CMP5::GetItemInfo( ItemInfo *p ) p->iMaxAmmo2 = -1; p->iMaxClip = MP5_MAX_CLIP; p->iSlot = 0; - p->iPosition = 4; + p->iPosition = 5; p->iFlags = 0; p->iId = m_iId = WEAPON_MP5; p->iWeight = MP5_WEIGHT; diff --git a/dlls/noffice/holster.cpp b/dlls/noffice/holster.cpp index 3ef6666d..cb0b5d83 100644 --- a/dlls/noffice/holster.cpp +++ b/dlls/noffice/holster.cpp @@ -66,7 +66,7 @@ int CHolster::GetItemInfo( ItemInfo *p ) p->iMaxAmmo2 = -1; p->iMaxClip = WEAPON_NOCLIP; p->iSlot = 0; - p->iPosition = 0; + p->iPosition = 1; p->iId = WEAPON_HOLSTER; p->iWeight = HOLSTER_WEIGHT; diff --git a/dlls/noffice/torch.cpp b/dlls/noffice/torch.cpp index 8b6d8477..250baf40 100644 --- a/dlls/noffice/torch.cpp +++ b/dlls/noffice/torch.cpp @@ -53,7 +53,7 @@ void CTorch::Precache() PRECACHE_SOUND( "items/flashlight1.wav" ); UTIL_PrecacheOther( "light_spot2" ); - UTIL_PrecacheOther( "wall_spot2" ); + UTIL_PrecacheOther( "wall_spot" ); } int CTorch::GetItemInfo( ItemInfo *p ) @@ -65,7 +65,7 @@ int CTorch::GetItemInfo( ItemInfo *p ) p->iMaxAmmo2 = -1; p->iMaxClip = WEAPON_NOCLIP; p->iSlot = 0; - p->iPosition = 1; + p->iPosition = 2; p->iId = WEAPON_TORCH; p->iWeight = TORCH_WEIGHT; diff --git a/dlls/shotgun.cpp b/dlls/shotgun.cpp index d87d24cd..ac9a49ff 100644 --- a/dlls/shotgun.cpp +++ b/dlls/shotgun.cpp @@ -102,7 +102,7 @@ int CShotgun::GetItemInfo( ItemInfo *p ) p->iMaxAmmo2 = -1; p->iMaxClip = SHOTGUN_MAX_CLIP; p->iSlot = 0; - p->iPosition = 5; + p->iPosition = 6; p->iFlags = 0; p->iId = m_iId = WEAPON_SHOTGUN; p->iWeight = SHOTGUN_WEIGHT; diff --git a/dlls/weapons.cpp b/dlls/weapons.cpp index d2272cb5..d9885681 100644 --- a/dlls/weapons.cpp +++ b/dlls/weapons.cpp @@ -339,10 +339,6 @@ void W_Precache( void ) // mp5 UTIL_PrecacheOtherWeapon( "weapon_9mmAR" ); UTIL_PrecacheOther( "ammo_9mmAR" ); - UTIL_PrecacheOther( "ammo_ARgrenades" ); - - // 9mm ammo box - UTIL_PrecacheOther( "ammo_9mmbox" ); #if !defined( OEM_BUILD ) && !defined( HLDEMO_BUILD ) if( g_pGameRules->IsDeathmatch() )