Browse Source

Merge branch 'master' into opfor

opforfixed
Andrey Akhmichin 4 years ago
parent
commit
660e21df7d
  1. 3
      cl_dll/CMakeLists.txt
  2. 6
      cl_dll/hud_spectator.cpp
  3. 113
      cl_dll/wscript
  4. 8
      cmake/LibraryNaming.cmake
  5. 2
      dlls/basemonster.h
  6. 8
      dlls/bigmomma.cpp
  7. 2
      dlls/bullsquid.cpp
  8. 12
      dlls/game.cpp
  9. 3
      dlls/game.h
  10. 8
      dlls/houndeye.cpp
  11. 21
      dlls/monsters.cpp
  12. 12
      dlls/multiplay_gamerules.cpp
  13. 2
      dlls/player.cpp
  14. 6
      dlls/singleplay_gamerules.cpp
  15. 137
      dlls/wscript
  16. 17
      public/build.h
  17. 12
      scripts/waifulib/library_naming.py
  18. 4
      wscript

3
cl_dll/CMakeLists.txt

@ -143,6 +143,9 @@ endif()
if(WIN32) if(WIN32)
target_link_libraries( ${CLDLL_LIBRARY} user32.lib ) target_link_libraries( ${CLDLL_LIBRARY} user32.lib )
if (GOLDSOURCE_SUPPORT)
target_link_libraries( ${CLDLL_LIBRARY} winmm.lib )
endif()
endif() endif()
set_target_properties (${CLDLL_LIBRARY} PROPERTIES set_target_properties (${CLDLL_LIBRARY} PROPERTIES

6
cl_dll/hud_spectator.cpp

@ -825,7 +825,7 @@ bool CHudSpectator::ParseOverviewFile()
char token[1024] = { 0 }; char token[1024] = { 0 };
float height; float height;
char *pfile = NULL; char *afile = NULL, *pfile = NULL;
memset( &m_OverviewData, 0, sizeof(m_OverviewData) ); memset( &m_OverviewData, 0, sizeof(m_OverviewData) );
@ -850,7 +850,7 @@ bool CHudSpectator::ParseOverviewFile()
sprintf( filename, "overviews/%s.txt", levelname ); sprintf( filename, "overviews/%s.txt", levelname );
pfile = (char *)gEngfuncs.COM_LoadFile( filename, 5, NULL ); afile = pfile = (char *)gEngfuncs.COM_LoadFile( filename, 5, NULL );
if( !pfile ) if( !pfile )
{ {
@ -963,7 +963,7 @@ bool CHudSpectator::ParseOverviewFile()
} }
} }
gEngfuncs.COM_FreeFile( pfile ); gEngfuncs.COM_FreeFile( afile );
m_mapZoom = m_OverviewData.zoom; m_mapZoom = m_OverviewData.zoom;
m_mapOrigin = m_OverviewData.origin; m_mapOrigin = m_OverviewData.origin;

113
cl_dll/wscript

@ -10,49 +10,109 @@ def options(opt):
return return
def configure(conf): def configure(conf):
if conf.env.GOLDSRC and conf.env.DEST_OS != 'win32':
conf.check_cc(lib='dl')
if conf.env.DEST_OS == 'win32': if conf.env.DEST_OS == 'win32':
conf.check_cxx( lib='user32' ) conf.check_cxx(lib='user32')
if conf.env.GOLDSRC:
if conf.env.DEST_OS == 'win32':
conf.check_cxx(lib='winmm')
else:
conf.check_cc(lib='dl')
def build(bld): def build(bld):
source = bld.path.parent.ant_glob([ source = bld.path.parent.ant_glob([
'pm_shared/*.c', 'pm_shared/*.c'
'dlls/crossbow.cpp', 'dlls/crowbar.cpp', 'dlls/egon.cpp', 'dlls/gauss.cpp', 'dlls/handgrenade.cpp', ])
'dlls/hornetgun.cpp', 'dlls/mp5.cpp', 'dlls/python.cpp', 'dlls/rpg.cpp', 'dlls/satchel.cpp', source += bld.path.ant_glob([
'dlls/shotgun.cpp', 'dlls/squeakgrenade.cpp', 'dlls/tripmine.cpp', 'dlls/glock.cpp' 'hl/*.cpp'
])
source += bld.path.parent.ant_glob([
'dlls/crossbow.cpp',
'dlls/crowbar.cpp',
'dlls/egon.cpp',
'dlls/gauss.cpp',
'dlls/glock.cpp',
'dlls/handgrenade.cpp',
'dlls/hornetgun.cpp',
'dlls/mp5.cpp',
'dlls/python.cpp',
'dlls/rpg.cpp',
'dlls/satchel.cpp',
'dlls/shotgun.cpp',
'dlls/squeakgrenade.cpp',
'dlls/tripmine.cpp'
]) ])
source += bld.path.ant_glob(['hl/*.cpp'])
source += [ source += [
'ev_hldm.cpp', 'ammo.cpp', 'ammo_secondary.cpp', 'ammohistory.cpp', 'GameStudioModelRenderer.cpp',
'battery.cpp', 'cdll_int.cpp', 'com_weapons.cpp', 'death.cpp', 'MOTD.cpp',
'demo.cpp', 'entity.cpp', 'ev_common.cpp', 'events.cpp', 'StudioModelRenderer.cpp',
'flashlight.cpp', 'GameStudioModelRenderer.cpp', 'geiger.cpp', 'ammo.cpp',
'health.cpp', 'hud.cpp', 'hud_msg.cpp', 'hud_redraw.cpp', 'ammo_secondary.cpp',
'hud_spectator.cpp', 'hud_update.cpp', 'in_camera.cpp', 'ammohistory.cpp',
'input.cpp', 'input_goldsource.cpp', 'input_mouse.cpp', 'battery.cpp',
'input_xash3d.cpp', 'menu.cpp', 'message.cpp', 'cdll_int.cpp',
'overview.cpp', 'parsemsg.cpp', 'saytext.cpp', 'com_weapons.cpp',
'status_icons.cpp', 'statusbar.cpp', 'studio_util.cpp', 'death.cpp',
'StudioModelRenderer.cpp', 'text_message.cpp', 'train.cpp', 'demo.cpp',
'tri.cpp', 'util.cpp', 'view.cpp', 'scoreboard.cpp', 'MOTD.cpp' 'entity.cpp',
'ev_hldm.cpp',
'ev_common.cpp',
'events.cpp',
'flashlight.cpp',
'geiger.cpp',
'health.cpp',
'hud.cpp',
'hud_msg.cpp',
'hud_redraw.cpp',
'hud_spectator.cpp',
'hud_update.cpp',
'in_camera.cpp',
'input.cpp',
'input_goldsource.cpp',
'input_mouse.cpp',
'input_xash3d.cpp',
'menu.cpp',
'message.cpp',
'overview.cpp',
'parsemsg.cpp',
'saytext.cpp',
'scoreboard.cpp',
'status_icons.cpp',
'statusbar.cpp',
'studio_util.cpp',
'text_message.cpp',
'train.cpp',
'tri.cpp',
'util.cpp',
'view.cpp'
] ]
includes = Utils.to_list('. hl/ ../dlls ../dlls/wpn_shared ../common ../engine ../pm_shared ../game_shared ../public ../utils/false_vgui/include') includes = [
'.',
'hl/',
'../dlls',
'../common',
'../engine',
'../pm_shared',
'../game_shared',
'../public',
'../utils/false_vgui/include'
]
defines = ['CLIENT_DLL'] defines = ['CLIENT_DLL']
if bld.env.GOLDSRC: if bld.env.GOLDSRC:
defines += ['GOLDSOURCE_SUPPORT'] defines += ['GOLDSOURCE_SUPPORT']
libs = [] libs = []
if bld.env.GOLDSRC and bld.env.DEST_OS != 'win32':
libs += ['DL']
if bld.env.DEST_OS == 'win32': if bld.env.DEST_OS == 'win32':
libs += ["USER32"] libs += ["USER32"]
if bld.env.GOLDSRC:
if bld.env.DEST_OS == 'win32':
libs += ["WINMM"]
else:
libs += ['DL']
if bld.env.DEST_OS not in ['android', 'dos']: if bld.env.DEST_OS not in ['android', 'dos']:
install_path = os.path.join(bld.env.GAMEDIR, bld.env.CLIENT_DIR) install_path = os.path.join(bld.env.GAMEDIR, bld.env.CLIENT_DIR)
else: else:
@ -70,3 +130,4 @@ def build(bld):
subsystem = bld.env.MSVC_SUBSYSTEM, subsystem = bld.env.MSVC_SUBSYSTEM,
idx = bld.get_taskgen_count() idx = bld.get_taskgen_count()
) )

8
cmake/LibraryNaming.cmake

@ -7,13 +7,13 @@ check_symbol_exists(XASH_AMD64 "build.h" XASH_AMD64)
check_symbol_exists(XASH_ANDROID "build.h" XASH_ANDROID) check_symbol_exists(XASH_ANDROID "build.h" XASH_ANDROID)
check_symbol_exists(XASH_APPLE "build.h" XASH_APPLE) check_symbol_exists(XASH_APPLE "build.h" XASH_APPLE)
check_symbol_exists(XASH_ARM "build.h" XASH_ARM) check_symbol_exists(XASH_ARM "build.h" XASH_ARM)
check_symbol_exists(XASH_ARM64 "build.h" XASH_ARM64)
check_symbol_exists(XASH_ARM_HARDFP "build.h" XASH_ARM_HARDFP) check_symbol_exists(XASH_ARM_HARDFP "build.h" XASH_ARM_HARDFP)
check_symbol_exists(XASH_ARM_SOFTFP "build.h" XASH_ARM_SOFTFP) check_symbol_exists(XASH_ARM_SOFTFP "build.h" XASH_ARM_SOFTFP)
check_symbol_exists(XASH_ARMv4 "build.h" XASH_ARMv4) check_symbol_exists(XASH_ARMv4 "build.h" XASH_ARMv4)
check_symbol_exists(XASH_ARMv5 "build.h" XASH_ARMv5) check_symbol_exists(XASH_ARMv5 "build.h" XASH_ARMv5)
check_symbol_exists(XASH_ARMv6 "build.h" XASH_ARMv6) check_symbol_exists(XASH_ARMv6 "build.h" XASH_ARMv6)
check_symbol_exists(XASH_ARMv7 "build.h" XASH_ARMv7) check_symbol_exists(XASH_ARMv7 "build.h" XASH_ARMv7)
check_symbol_exists(XASH_ARMv8 "build.h" XASH_ARMv8)
check_symbol_exists(XASH_BIG_ENDIAN "build.h" XASH_BIG_ENDIAN) check_symbol_exists(XASH_BIG_ENDIAN "build.h" XASH_BIG_ENDIAN)
check_symbol_exists(XASH_BSD "build.h" XASH_BSD) check_symbol_exists(XASH_BSD "build.h" XASH_BSD)
check_symbol_exists(XASH_E2K "build.h" XASH_E2K) check_symbol_exists(XASH_E2K "build.h" XASH_E2K)
@ -55,11 +55,13 @@ if(XASH_AMD64)
set(BUILDARCH "amd64") set(BUILDARCH "amd64")
elseif(XASH_X86) elseif(XASH_X86)
set(BUILDARCH "") set(BUILDARCH "")
elseif(XASH_ARM64) elseif(XASH_ARM AND XASH_64BIT)
set(BUILDARCH "arm64") set(BUILDARCH "arm64")
elseif(XASH_ARM) elseif(XASH_ARM)
set(BUILDARCH "armv") set(BUILDARCH "armv")
if(XASH_ARMv7) if(XASH_ARMv8)
set(BUILDARCH "${BUILDARCH}8_32")
elseif(XASH_ARMv7)
set(BUILDARCH "${BUILDARCH}7") set(BUILDARCH "${BUILDARCH}7")
elseif(XASH_ARMv6) elseif(XASH_ARMv6)
set(BUILDARCH "${BUILDARCH}6") set(BUILDARCH "${BUILDARCH}6")

2
dlls/basemonster.h

@ -330,6 +330,8 @@ public:
CBaseEntity* DropItem ( const char *pszItemName, const Vector &vecPos, const Vector &vecAng );// drop an item. CBaseEntity* DropItem ( const char *pszItemName, const Vector &vecPos, const Vector &vecAng );// drop an item.
float m_flLastYawTime; // TODO: check valid offset
// //
// Glowshell effects // Glowshell effects
// //

8
dlls/bigmomma.cpp

@ -933,7 +933,7 @@ void CBigMomma::StartTask( Task_t *pTask )
TaskComplete(); TaskComplete();
break; break;
case TASK_WAIT_NODE: case TASK_WAIT_NODE:
m_flWait = gpGlobals->time + GetNodeDelay(); m_flWaitFinished = gpGlobals->time + GetNodeDelay();
if( m_hTargetEnt->pev->spawnflags & SF_INFOBM_WAIT ) if( m_hTargetEnt->pev->spawnflags & SF_INFOBM_WAIT )
ALERT( at_aiconsole, "BM: Wait at node %s forever\n", STRING( pev->netname ) ); ALERT( at_aiconsole, "BM: Wait at node %s forever\n", STRING( pev->netname ) );
else else
@ -1009,8 +1009,10 @@ void CBigMomma::RunTask( Task_t *pTask )
return; return;
if( gpGlobals->time > m_flWaitFinished ) if( gpGlobals->time > m_flWaitFinished )
{
TaskComplete(); TaskComplete();
ALERT( at_aiconsole, "BM: The WAIT is over!\n" ); ALERT( at_aiconsole, "BM: The WAIT is over!\n" );
}
break; break;
case TASK_PLAY_NODE_PRESEQUENCE: case TASK_PLAY_NODE_PRESEQUENCE:
case TASK_PLAY_NODE_SEQUENCE: case TASK_PLAY_NODE_SEQUENCE:
@ -1106,7 +1108,7 @@ void CBMortar::Spawn( void )
UTIL_SetSize( pev, Vector( 0, 0, 0 ), Vector( 0, 0, 0 ) ); UTIL_SetSize( pev, Vector( 0, 0, 0 ), Vector( 0, 0, 0 ) );
m_maxFrame = (float) MODEL_FRAMES( pev->modelindex ) - 1; m_maxFrame = MODEL_FRAMES( pev->modelindex ) - 1;
pev->dmgtime = gpGlobals->time + 0.4f; pev->dmgtime = gpGlobals->time + 0.4f;
} }

2
dlls/bullsquid.cpp

@ -81,7 +81,7 @@ void CSquidSpit::Spawn( void )
UTIL_SetSize( pev, Vector( 0, 0, 0 ), Vector( 0, 0, 0 ) ); UTIL_SetSize( pev, Vector( 0, 0, 0 ), Vector( 0, 0, 0 ) );
m_maxFrame = (float)MODEL_FRAMES( pev->modelindex ) - 1; m_maxFrame = MODEL_FRAMES( pev->modelindex ) - 1;
} }
void CSquidSpit::Animate( void ) void CSquidSpit::Animate( void )

12
dlls/game.cpp

@ -32,9 +32,10 @@ cvar_t timelimit = { "mp_timelimit","0", FCVAR_SERVER };
cvar_t friendlyfire = { "mp_friendlyfire","0", FCVAR_SERVER }; cvar_t friendlyfire = { "mp_friendlyfire","0", FCVAR_SERVER };
cvar_t falldamage = { "mp_falldamage","0", FCVAR_SERVER }; cvar_t falldamage = { "mp_falldamage","0", FCVAR_SERVER };
cvar_t weaponstay = { "mp_weaponstay","0", FCVAR_SERVER }; cvar_t weaponstay = { "mp_weaponstay","0", FCVAR_SERVER };
cvar_t selfgauss = { "mp_selfgauss", "1", FCVAR_SERVER }; cvar_t selfgauss = { "selfgauss", "1", FCVAR_SERVER };
cvar_t chargerfix = { "mp_chargerfix", "0", FCVAR_SERVER }; cvar_t chargerfix = { "chargerfix", "0", FCVAR_SERVER };
cvar_t satchelfix = { "mp_satchelfix", "0", FCVAR_SERVER }; cvar_t satchelfix = { "satchelfix", "0", FCVAR_SERVER };
cvar_t monsteryawspeedfix = { "monsteryawspeedfix", "0", FCVAR_SERVER };
cvar_t forcerespawn = { "mp_forcerespawn","1", FCVAR_SERVER }; cvar_t forcerespawn = { "mp_forcerespawn","1", FCVAR_SERVER };
cvar_t flashlight = { "mp_flashlight","0", FCVAR_SERVER }; cvar_t flashlight = { "mp_flashlight","0", FCVAR_SERVER };
cvar_t aimcrosshair = { "mp_autocrosshair","1", FCVAR_SERVER }; cvar_t aimcrosshair = { "mp_autocrosshair","1", FCVAR_SERVER };
@ -55,6 +56,8 @@ cvar_t *g_psv_gravity = NULL;
cvar_t *g_psv_aim = NULL; cvar_t *g_psv_aim = NULL;
cvar_t *g_footsteps = NULL; cvar_t *g_footsteps = NULL;
cvar_t *g_psv_developer;
//CVARS FOR SKILL LEVEL SETTINGS //CVARS FOR SKILL LEVEL SETTINGS
// Agrunt // Agrunt
cvar_t sk_agrunt_health1 = {"sk_agrunt_health1","0"}; cvar_t sk_agrunt_health1 = {"sk_agrunt_health1","0"};
@ -726,6 +729,8 @@ void GameDLLInit( void )
g_psv_aim = CVAR_GET_POINTER( "sv_aim" ); g_psv_aim = CVAR_GET_POINTER( "sv_aim" );
g_footsteps = CVAR_GET_POINTER( "mp_footsteps" ); g_footsteps = CVAR_GET_POINTER( "mp_footsteps" );
g_psv_developer = CVAR_GET_POINTER( "developer" );
CVAR_REGISTER( &displaysoundlist ); CVAR_REGISTER( &displaysoundlist );
CVAR_REGISTER( &allow_spectators ); CVAR_REGISTER( &allow_spectators );
@ -742,6 +747,7 @@ void GameDLLInit( void )
CVAR_REGISTER( &selfgauss ); CVAR_REGISTER( &selfgauss );
CVAR_REGISTER( &chargerfix ); CVAR_REGISTER( &chargerfix );
CVAR_REGISTER( &satchelfix ); CVAR_REGISTER( &satchelfix );
CVAR_REGISTER( &monsteryawspeedfix );
CVAR_REGISTER( &forcerespawn ); CVAR_REGISTER( &forcerespawn );
CVAR_REGISTER( &flashlight ); CVAR_REGISTER( &flashlight );
CVAR_REGISTER( &aimcrosshair ); CVAR_REGISTER( &aimcrosshair );

3
dlls/game.h

@ -30,6 +30,7 @@ extern cvar_t weaponstay;
extern cvar_t selfgauss; extern cvar_t selfgauss;
extern cvar_t chargerfix; extern cvar_t chargerfix;
extern cvar_t satchelfix; extern cvar_t satchelfix;
extern cvar_t monsteryawspeedfix;
extern cvar_t forcerespawn; extern cvar_t forcerespawn;
extern cvar_t flashlight; extern cvar_t flashlight;
extern cvar_t aimcrosshair; extern cvar_t aimcrosshair;
@ -43,4 +44,6 @@ extern cvar_t allowmonsters;
extern cvar_t *g_psv_gravity; extern cvar_t *g_psv_gravity;
extern cvar_t *g_psv_aim; extern cvar_t *g_psv_aim;
extern cvar_t *g_footsteps; extern cvar_t *g_footsteps;
extern cvar_t *g_psv_developer;
#endif // GAME_H #endif // GAME_H

8
dlls/houndeye.cpp

@ -35,7 +35,7 @@ extern CGraph WorldGraph;
#define HOUNDEYE_MAX_ATTACK_RADIUS 384.0f #define HOUNDEYE_MAX_ATTACK_RADIUS 384.0f
#define HOUNDEYE_SQUAD_BONUS 1.1f #define HOUNDEYE_SQUAD_BONUS 1.1f
#define HOUNDEYE_EYE_FRAMES 4 // how many different switchable maps for the eye #define HOUNDEYE_EYE_FRAMES 3 // how many different switchable maps for the eye
#define HOUNDEYE_SOUND_STARTLE_VOLUME 128 // how loud a sound has to be to badly scare a sleeping houndeye #define HOUNDEYE_SOUND_STARTLE_VOLUME 128 // how loud a sound has to be to badly scare a sleeping houndeye
@ -785,6 +785,11 @@ void CHoundeye::RunTask( Task_t *pTask )
{ {
pev->skin++; pev->skin++;
} }
if( pev->skin == HOUNDEYE_EYE_FRAMES - 1 )
{
TaskComplete();
}
break; break;
} }
case TASK_HOUND_HOP_BACK: case TASK_HOUND_HOP_BACK:
@ -954,6 +959,7 @@ Task_t tlHoundSleep[] =
{ TASK_HOUND_FALL_ASLEEP, (float)0 }, { TASK_HOUND_FALL_ASLEEP, (float)0 },
{ TASK_WAIT_RANDOM, (float)25 }, { TASK_WAIT_RANDOM, (float)25 },
{ TASK_HOUND_CLOSE_EYE, (float)0 }, { TASK_HOUND_CLOSE_EYE, (float)0 },
{ TASK_WAIT_INDEFINITE, (float)0 },
//{ TASK_WAIT, (float)10 }, //{ TASK_WAIT, (float)10 },
//{ TASK_WAIT_RANDOM, (float)10 }, //{ TASK_WAIT_RANDOM, (float)10 },
}; };

21
dlls/monsters.cpp

@ -33,6 +33,7 @@
#include "decals.h" #include "decals.h"
#include "soundent.h" #include "soundent.h"
#include "gamerules.h" #include "gamerules.h"
#include "game.h"
#define MONSTER_CUT_CORNER_DIST 8 // 8 means the monster's bounding box is contained without the box of the node in WC #define MONSTER_CUT_CORNER_DIST 8 // 8 means the monster's bounding box is contained without the box of the node in WC
@ -2032,6 +2033,8 @@ void CBaseMonster::MonsterInit( void )
SetThink( &CBaseMonster::MonsterInitThink ); SetThink( &CBaseMonster::MonsterInitThink );
pev->nextthink = gpGlobals->time + 0.1f; pev->nextthink = gpGlobals->time + 0.1f;
SetUse( &CBaseMonster::MonsterUse ); SetUse( &CBaseMonster::MonsterUse );
m_flLastYawTime = gpGlobals->time;
} }
//========================================================= //=========================================================
@ -2077,7 +2080,9 @@ void CBaseMonster::StartMonster( void )
if( !WALK_MOVE( ENT( pev ), 0, 0, WALKMOVE_NORMAL ) ) if( !WALK_MOVE( ENT( pev ), 0, 0, WALKMOVE_NORMAL ) )
{ {
ALERT( at_error, "Monster %s stuck in wall--level design error\n", STRING( pev->classname ) ); ALERT( at_error, "Monster %s stuck in wall--level design error\n", STRING( pev->classname ) );
pev->effects = EF_BRIGHTFIELD;
if( g_psv_developer && g_psv_developer->value )
pev->effects = EF_BRIGHTFIELD;
} }
} }
else else
@ -2515,7 +2520,17 @@ float CBaseMonster::ChangeYaw( int yawSpeed )
ideal = pev->ideal_yaw; ideal = pev->ideal_yaw;
if( current != ideal ) if( current != ideal )
{ {
speed = (float)yawSpeed * gpGlobals->frametime * 10; if( monsteryawspeedfix.value )
{
float delta;
delta = Q_min( gpGlobals->time - m_flLastYawTime, 0.25f );
speed = (float)yawSpeed * delta * 2;
}
else
speed = (float)yawSpeed * gpGlobals->frametime * 10;
move = ideal - current; move = ideal - current;
if( ideal > current ) if( ideal > current )
@ -2559,6 +2574,8 @@ float CBaseMonster::ChangeYaw( int yawSpeed )
else else
move = 0; move = 0;
m_flLastYawTime = gpGlobals->time;
return move; return move;
} }

12
dlls/multiplay_gamerules.cpp

@ -366,6 +366,12 @@ BOOL CHalfLifeMultiplay::FShouldSwitchWeapon( CBasePlayer *pPlayer, CBasePlayerI
return FALSE; return FALSE;
} }
if( pPlayer->m_iAutoWepSwitch == 2
&& pPlayer->m_afButtonLast & ( IN_ATTACK | IN_ATTACK2 ) )
{
return FALSE;
}
if( !pPlayer->m_pActiveItem->CanHolster() ) if( !pPlayer->m_pActiveItem->CanHolster() )
{ {
// can't put away the active item. // can't put away the active item.
@ -615,7 +621,11 @@ void CHalfLifeMultiplay::PlayerSpawn( CBasePlayer *pPlayer )
{ {
BOOL addDefault; BOOL addDefault;
CBaseEntity *pWeaponEntity = NULL; CBaseEntity *pWeaponEntity = NULL;
int iOldAutoWepSwitch;
iOldAutoWepSwitch = pPlayer->m_iAutoWepSwitch;
pPlayer->m_iAutoWepSwitch = 1;
pPlayer->pev->weapons |= ( 1 << WEAPON_SUIT ); pPlayer->pev->weapons |= ( 1 << WEAPON_SUIT );
addDefault = TRUE; addDefault = TRUE;
@ -632,6 +642,8 @@ void CHalfLifeMultiplay::PlayerSpawn( CBasePlayer *pPlayer )
pPlayer->GiveNamedItem( "weapon_9mmhandgun" ); pPlayer->GiveNamedItem( "weapon_9mmhandgun" );
pPlayer->GiveAmmo( 68, "9mm", _9MM_MAX_CARRY );// 4 full reloads pPlayer->GiveAmmo( 68, "9mm", _9MM_MAX_CARRY );// 4 full reloads
} }
pPlayer->m_iAutoWepSwitch = iOldAutoWepSwitch;
} }
//========================================================= //=========================================================

2
dlls/player.cpp

@ -3080,8 +3080,6 @@ void CBasePlayer::Spawn( void )
m_fInXen = FALSE; m_fInXen = FALSE;
m_iAutoWepSwitch = 1;
g_pGameRules->PlayerSpawn( this ); g_pGameRules->PlayerSpawn( this );
} }

6
dlls/singleplay_gamerules.cpp

@ -80,6 +80,12 @@ BOOL CHalfLifeRules::FShouldSwitchWeapon( CBasePlayer *pPlayer, CBasePlayerItem
return FALSE; return FALSE;
} }
if( pPlayer->m_iAutoWepSwitch == 2
&& pPlayer->m_afButtonLast & ( IN_ATTACK | IN_ATTACK2 ) )
{
return FALSE;
}
if( !pPlayer->m_pActiveItem->CanHolster() ) if( !pPlayer->m_pActiveItem->CanHolster() )
{ {
return FALSE; return FALSE;

137
dlls/wscript

@ -21,44 +21,130 @@ def configure(conf):
conf.fatal("Could not find hl.def") conf.fatal("Could not find hl.def")
def build(bld): def build(bld):
defines = []
source = bld.path.parent.ant_glob([ source = bld.path.parent.ant_glob([
'pm_shared/*.c', 'pm_shared/*.c',
]) ])
source += [ source += [
'agrunt.cpp', 'airtank.cpp', 'aflock.cpp', 'animating.cpp', 'animation.cpp', 'apache.cpp', 'agrunt.cpp',
'barnacle.cpp', 'barney.cpp', 'bigmomma.cpp', 'bloater.cpp', 'bmodels.cpp', 'bullsquid.cpp', 'buttons.cpp', 'airtank.cpp',
'cbase.cpp', 'client.cpp', 'combat.cpp', 'controller.cpp', 'crossbow.cpp', 'crowbar.cpp', 'aflock.cpp',
'defaultai.cpp', 'doors.cpp', 'animating.cpp',
'effects.cpp', 'egon.cpp', 'explode.cpp', 'animation.cpp',
'flyingmonster.cpp', 'func_break.cpp', 'func_tank.cpp', 'apache.cpp',
'game.cpp', 'gamerules.cpp', 'gargantua.cpp', 'gauss.cpp', 'genericmonster.cpp', 'ggrenade.cpp', 'globals.cpp', 'glock.cpp', 'gman.cpp', 'barnacle.cpp',
'h_ai.cpp', 'h_battery.cpp', 'h_cine.cpp', 'h_cycler.cpp', 'h_export.cpp', 'handgrenade.cpp', 'hassassin.cpp', 'headcrab.cpp', 'barney.cpp',
'healthkit.cpp', 'hgrunt.cpp', 'hornet.cpp', 'hornetgun.cpp', 'houndeye.cpp', 'bigmomma.cpp',
'ichthyosaur.cpp', 'islave.cpp', 'items.cpp', 'bloater.cpp',
'leech.cpp', 'lights.cpp', 'bmodels.cpp',
'maprules.cpp', 'monstermaker.cpp', 'monsters.cpp', 'monsterstate.cpp', 'mortar.cpp', 'mp5.cpp', 'multiplay_gamerules.cpp', 'bullsquid.cpp',
'nihilanth.cpp', 'nodes.cpp', 'buttons.cpp',
'observer.cpp', 'osprey.cpp', 'cbase.cpp',
'pathcorner.cpp', 'plane.cpp', 'plats.cpp', 'player.cpp', 'playermonster.cpp', 'python.cpp', 'client.cpp',
'rat.cpp', 'roach.cpp', 'rpg.cpp', 'combat.cpp',
'satchel.cpp', 'schedule.cpp', 'scientist.cpp', 'scripted.cpp', 'shotgun.cpp', 'singleplay_gamerules.cpp', 'skill.cpp', 'controller.cpp',
'sound.cpp', 'soundent.cpp', 'spectator.cpp', 'squadmonster.cpp', 'squeakgrenade.cpp', 'subs.cpp', 'crossbow.cpp',
'talkmonster.cpp', 'teamplay_gamerules.cpp', 'tempmonster.cpp', 'tentacle.cpp', 'crowbar.cpp',
'triggers.cpp', 'tripmine.cpp', 'turret.cpp', 'defaultai.cpp',
'doors.cpp',
'effects.cpp',
'egon.cpp',
'explode.cpp',
'flyingmonster.cpp',
'func_break.cpp',
'func_tank.cpp',
'game.cpp',
'gamerules.cpp',
'gargantua.cpp',
'gauss.cpp',
'genericmonster.cpp',
'ggrenade.cpp',
'globals.cpp',
'glock.cpp',
'gman.cpp',
'h_ai.cpp',
'h_battery.cpp',
'h_cine.cpp',
'h_cycler.cpp',
'h_export.cpp',
'handgrenade.cpp',
'hassassin.cpp',
'headcrab.cpp',
'healthkit.cpp',
'hgrunt.cpp',
'hornet.cpp',
'hornetgun.cpp',
'houndeye.cpp',
'ichthyosaur.cpp',
'islave.cpp',
'items.cpp',
'leech.cpp',
'lights.cpp',
'maprules.cpp',
'monstermaker.cpp',
'monsters.cpp',
'monsterstate.cpp',
'mortar.cpp',
'mp5.cpp',
'multiplay_gamerules.cpp',
'nihilanth.cpp',
'nodes.cpp',
'observer.cpp',
'osprey.cpp',
'pathcorner.cpp',
'plane.cpp',
'plats.cpp',
'player.cpp',
'playermonster.cpp',
'python.cpp',
'rat.cpp',
'roach.cpp',
'rpg.cpp',
'satchel.cpp',
'schedule.cpp',
'scientist.cpp',
'scripted.cpp',
'shotgun.cpp',
'singleplay_gamerules.cpp',
'skill.cpp',
'sound.cpp',
'soundent.cpp',
'spectator.cpp',
'squadmonster.cpp',
'squeakgrenade.cpp',
'subs.cpp',
'talkmonster.cpp',
'teamplay_gamerules.cpp',
'tempmonster.cpp',
'tentacle.cpp',
'triggers.cpp',
'tripmine.cpp',
'turret.cpp',
'util.cpp', 'util.cpp',
'weapons.cpp', 'world.cpp', 'xen.cpp', 'zombie.cpp'] 'weapons.cpp',
'world.cpp',
'xen.cpp',
'zombie.cpp'
]
includes = [
'.',
'../common',
'../engine',
'../pm_shared',
'../game_shared',
'../public'
]
defines = []
if bld.env.VOICEMGR: if bld.env.VOICEMGR:
source += bld.path.parent.ant_glob([ source += bld.path.parent.ant_glob([
'game_shared/voice_gamemgr.cpp', 'game_shared/voice_gamemgr.cpp',
]) ])
else: else:
defines += ['NO_VOICEGAMEMGR'] defines += ['NO_VOICEGAMEMGR']
includes = Utils.to_list('. wpn_shared ../common ../engine ../pm_shared ../game_shared ../public')
libs = [] libs = []
if bld.env.DEST_OS not in ['android', 'dos']: if bld.env.DEST_OS not in ['android', 'dos']:
@ -78,3 +164,4 @@ def build(bld):
subsystem = bld.env.MSVC_SUBSYSTEM, subsystem = bld.env.MSVC_SUBSYSTEM,
idx = bld.get_taskgen_count() idx = bld.get_taskgen_count()
) )

17
public/build.h

@ -45,13 +45,13 @@ For more information, please refer to <http://unlicense.org/>
#undef XASH_ANDROID #undef XASH_ANDROID
#undef XASH_APPLE #undef XASH_APPLE
#undef XASH_ARM #undef XASH_ARM
#undef XASH_ARM64
#undef XASH_ARM_HARDFP #undef XASH_ARM_HARDFP
#undef XASH_ARM_SOFTFP #undef XASH_ARM_SOFTFP
#undef XASH_ARMv4 #undef XASH_ARMv4
#undef XASH_ARMv5 #undef XASH_ARMv5
#undef XASH_ARMv6 #undef XASH_ARMv6
#undef XASH_ARMv7 #undef XASH_ARMv7
#undef XASH_ARMv8
//#undef XASH_BIG_ENDIAN //#undef XASH_BIG_ENDIAN
#undef XASH_BSD #undef XASH_BSD
#undef XASH_E2K #undef XASH_E2K
@ -169,14 +169,13 @@ For more information, please refer to <http://unlicense.org/>
#define XASH_AMD64 1 #define XASH_AMD64 1
#elif defined(__i386__) || defined(_X86_) || defined(_M_IX86) #elif defined(__i386__) || defined(_X86_) || defined(_M_IX86)
#define XASH_X86 1 #define XASH_X86 1
#elif defined __aarch64__ #elif defined __aarch64__ || defined _M_ARM64
#define XASH_64BIT 1 #define XASH_64BIT 1
#define XASH_ARM64 1 #define XASH_ARM 8
#elif defined __arm__ || defined _M_ARM #elif defined __arm__ || defined _M_ARM
#if defined _M_ARM #if __ARM_ARCH == 8 || __ARM_ARCH_8__
// msvc can only armv7 ? #define XASH_ARM 8
#define XASH_ARM 7 #elif __ARM_ARCH == 7 || __ARM_ARCH_7__ || defined _M_ARM // msvc can only armv7 in 32 bit
#elif __ARM_ARCH == 7 || __ARM_ARCH_7__
#define XASH_ARM 7 #define XASH_ARM 7
#elif __ARM_ARCH == 6 || __ARM_ARCH_6__ || __ARM_ARCH_6J__ #elif __ARM_ARCH == 6 || __ARM_ARCH_6__ || __ARM_ARCH_6J__
#define XASH_ARM 6 #define XASH_ARM 6
@ -212,7 +211,9 @@ For more information, please refer to <http://unlicense.org/>
#define XASH_64BIT 1 #define XASH_64BIT 1
#endif #endif
#if XASH_ARM == 7 #if XASH_ARM == 8
#define XASH_ARMv8 1
#elif XASH_ARM == 7
#define XASH_ARMv7 1 #define XASH_ARMv7 1
#elif XASH_ARM == 6 #elif XASH_ARM == 6
#define XASH_ARMv6 1 #define XASH_ARMv6 1

12
scripts/waifulib/library_naming.py

@ -25,13 +25,13 @@ DEFINES = [
'XASH_ANDROID', 'XASH_ANDROID',
'XASH_APPLE', 'XASH_APPLE',
'XASH_ARM', 'XASH_ARM',
'XASH_ARM64',
'XASH_ARM_HARDFP', 'XASH_ARM_HARDFP',
'XASH_ARM_SOFTFP', 'XASH_ARM_SOFTFP',
'XASH_ARMv4', 'XASH_ARMv4',
'XASH_ARMv5', 'XASH_ARMv5',
'XASH_ARMv6', 'XASH_ARMv6',
'XASH_ARMv7', 'XASH_ARMv7',
'XASH_ARMv8',
'XASH_BIG_ENDIAN', 'XASH_BIG_ENDIAN',
'XASH_BSD', 'XASH_BSD',
'XASH_E2K', 'XASH_E2K',
@ -61,9 +61,9 @@ def configure(conf):
'fragment': CHECK_SYMBOL_EXISTS_FRAGMENT % (x, x), 'fragment': CHECK_SYMBOL_EXISTS_FRAGMENT % (x, x),
'includes': [conf.path.find_node('public/').abspath()], 'includes': [conf.path.find_node('public/').abspath()],
'define_name': x }, DEFINES ) 'define_name': x }, DEFINES )
conf.multicheck(*tests, msg = '', mandatory = False, quiet = True) conf.multicheck(*tests, msg = '', mandatory = False, quiet = True)
# engine/common/build.c # engine/common/build.c
if conf.env.XASH_ANDROID: if conf.env.XASH_ANDROID:
buildos = "android" buildos = "android"
@ -87,11 +87,13 @@ def configure(conf):
buildarch = "amd64" buildarch = "amd64"
elif conf.env.XASH_X86: elif conf.env.XASH_X86:
buildarch = "" buildarch = ""
elif conf.env.XASH_ARM64: elif conf.env.XASH_ARM and conf.env.XASH_64BIT:
buildarch = "arm64" buildarch = "arm64"
elif conf.env.XASH_ARM: elif conf.env.XASH_ARM:
buildarch = "armv" buildarch = "armv"
if conf.env.XASH_ARMv7: if conf.env.XASH_ARMv8:
buildarch += "8_32"
elif conf.env.XASH_ARMv7:
buildarch += "7" buildarch += "7"
elif conf.env.XASH_ARMv6: elif conf.env.XASH_ARMv6:
buildarch += "6" buildarch += "6"

4
wscript

@ -271,6 +271,10 @@ def configure(conf):
conf.env.cxxshlib_PATTERN = conf.env.cxxshlib_PATTERN[3:] conf.env.cxxshlib_PATTERN = conf.env.cxxshlib_PATTERN[3:]
conf.define('CLIENT_WEAPONS', '1') conf.define('CLIENT_WEAPONS', '1')
conf.define('CROWBAR_IDLE_ANIM', False)
conf.define('CROWBAR_DELAY_FIX', False)
conf.define('CROWBAR_FIX_RAPID_CROWBAR', False)
conf.define('GAUSS_OVERCHARGE_FIX', False)
if conf.env.DEST_OS == 'android' or conf.options.ENABLE_MOD_HACKS: if conf.env.DEST_OS == 'android' or conf.options.ENABLE_MOD_HACKS:
conf.define('MOBILE_HACKS', '1') conf.define('MOBILE_HACKS', '1')

Loading…
Cancel
Save