From 54181adc8e401e3e3aba58d876639faa85fd19b0 Mon Sep 17 00:00:00 2001 From: Roman Chistokhodov Date: Tue, 28 Apr 2020 23:37:07 +0300 Subject: [PATCH 01/16] Fix bigmomma node wait --- dlls/bigmomma.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/dlls/bigmomma.cpp b/dlls/bigmomma.cpp index d67d10f7..7e893e28 100644 --- a/dlls/bigmomma.cpp +++ b/dlls/bigmomma.cpp @@ -931,7 +931,7 @@ void CBigMomma::StartTask( Task_t *pTask ) TaskComplete(); break; case TASK_WAIT_NODE: - m_flWait = gpGlobals->time + GetNodeDelay(); + m_flWaitFinished = gpGlobals->time + GetNodeDelay(); if( m_hTargetEnt->pev->spawnflags & SF_INFOBM_WAIT ) ALERT( at_aiconsole, "BM: Wait at node %s forever\n", STRING( pev->netname ) ); else @@ -1007,8 +1007,10 @@ void CBigMomma::RunTask( Task_t *pTask ) return; if( gpGlobals->time > m_flWaitFinished ) + { TaskComplete(); - ALERT( at_aiconsole, "BM: The WAIT is over!\n" ); + ALERT( at_aiconsole, "BM: The WAIT is over!\n" ); + } break; case TASK_PLAY_NODE_PRESEQUENCE: case TASK_PLAY_NODE_SEQUENCE: From c2064d88ed8237bc9dc907e28d1f21e75750561f Mon Sep 17 00:00:00 2001 From: Roman Chistokhodov Date: Sun, 10 May 2020 21:57:11 +0300 Subject: [PATCH 02/16] Remove redundant casts to float when retrieving model frames --- dlls/bigmomma.cpp | 2 +- dlls/bullsquid.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/dlls/bigmomma.cpp b/dlls/bigmomma.cpp index 7e893e28..a73334ff 100644 --- a/dlls/bigmomma.cpp +++ b/dlls/bigmomma.cpp @@ -1106,7 +1106,7 @@ void CBMortar::Spawn( void ) 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; } diff --git a/dlls/bullsquid.cpp b/dlls/bullsquid.cpp index e035b0c9..5be5135a 100644 --- a/dlls/bullsquid.cpp +++ b/dlls/bullsquid.cpp @@ -95,7 +95,7 @@ void CSquidSpit::Spawn( void ) 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 ) From 0324eb0431d6f6e5c0352e01c3486fe84ff55b4f Mon Sep 17 00:00:00 2001 From: Andrey Akhmichin Date: Sat, 25 Jul 2020 09:28:02 +0500 Subject: [PATCH 03/16] Fix possible memory leak. --- cl_dll/hud_spectator.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/cl_dll/hud_spectator.cpp b/cl_dll/hud_spectator.cpp index f666b5e6..ce32e4e2 100644 --- a/cl_dll/hud_spectator.cpp +++ b/cl_dll/hud_spectator.cpp @@ -825,7 +825,7 @@ bool CHudSpectator::ParseOverviewFile() char token[1024] = { 0 }; float height; - char *pfile = NULL; + char *afile = NULL, *pfile = NULL; memset( &m_OverviewData, 0, sizeof(m_OverviewData) ); @@ -850,7 +850,7 @@ bool CHudSpectator::ParseOverviewFile() 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 ) { @@ -963,7 +963,7 @@ bool CHudSpectator::ParseOverviewFile() } } - gEngfuncs.COM_FreeFile( pfile ); + gEngfuncs.COM_FreeFile( afile ); m_mapZoom = m_OverviewData.zoom; m_mapOrigin = m_OverviewData.origin; From 1d1c99af9fd4655546a786ccc73c3dab8efc9f09 Mon Sep 17 00:00:00 2001 From: Andrey Akhmichin Date: Sat, 25 Jul 2020 13:29:14 +0500 Subject: [PATCH 04/16] Merge https://github.com/ValveSoftware/halflife/pull/2898/commits/e98a18a980eb4d850bd1a8d4458f2475c8c2ee0f --- dlls/houndeye.cpp | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/dlls/houndeye.cpp b/dlls/houndeye.cpp index 2b8cadb0..ba388b63 100644 --- a/dlls/houndeye.cpp +++ b/dlls/houndeye.cpp @@ -35,7 +35,7 @@ extern CGraph WorldGraph; #define HOUNDEYE_MAX_ATTACK_RADIUS 384.0f #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 @@ -783,6 +783,11 @@ void CHoundeye::RunTask( Task_t *pTask ) { pev->skin++; } + + if( pev->skin == HOUNDEYE_EYE_FRAMES - 1 ) + { + TaskComplete(); + } break; } case TASK_HOUND_HOP_BACK: @@ -952,6 +957,7 @@ Task_t tlHoundSleep[] = { TASK_HOUND_FALL_ASLEEP, (float)0 }, { TASK_WAIT_RANDOM, (float)25 }, { TASK_HOUND_CLOSE_EYE, (float)0 }, + { TASK_WAIT_INDEFINITE, (float)0 }, //{ TASK_WAIT, (float)10 }, //{ TASK_WAIT_RANDOM, (float)10 }, }; From e239f3e1a51eaef117437f1ee2445e8acba7475b Mon Sep 17 00:00:00 2001 From: Andrey Akhmichin Date: Sat, 1 Aug 2020 19:27:51 +0500 Subject: [PATCH 05/16] Set EF_BRIGHTFIELD flag for monsters which stuck in the wall only in developer mode. --- dlls/game.cpp | 4 ++++ dlls/game.h | 2 ++ dlls/monsters.cpp | 5 ++++- 3 files changed, 10 insertions(+), 1 deletion(-) diff --git a/dlls/game.cpp b/dlls/game.cpp index 5e2701d3..c48b44b3 100644 --- a/dlls/game.cpp +++ b/dlls/game.cpp @@ -55,6 +55,8 @@ cvar_t *g_psv_gravity = NULL; cvar_t *g_psv_aim = NULL; cvar_t *g_footsteps = NULL; +cvar_t *g_psv_developer; + //CVARS FOR SKILL LEVEL SETTINGS // Agrunt cvar_t sk_agrunt_health1 = {"sk_agrunt_health1","0"}; @@ -462,6 +464,8 @@ void GameDLLInit( void ) g_psv_aim = CVAR_GET_POINTER( "sv_aim" ); g_footsteps = CVAR_GET_POINTER( "mp_footsteps" ); + g_psv_developer = CVAR_GET_POINTER( "developer" ); + CVAR_REGISTER( &displaysoundlist ); CVAR_REGISTER( &allow_spectators ); diff --git a/dlls/game.h b/dlls/game.h index 7eb665c6..026070ff 100644 --- a/dlls/game.h +++ b/dlls/game.h @@ -43,4 +43,6 @@ extern cvar_t allowmonsters; extern cvar_t *g_psv_gravity; extern cvar_t *g_psv_aim; extern cvar_t *g_footsteps; + +extern cvar_t *g_psv_developer; #endif // GAME_H diff --git a/dlls/monsters.cpp b/dlls/monsters.cpp index e14dbace..57de767d 100644 --- a/dlls/monsters.cpp +++ b/dlls/monsters.cpp @@ -33,6 +33,7 @@ #include "decals.h" #include "soundent.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 @@ -2066,7 +2067,9 @@ void CBaseMonster::StartMonster( void ) if( !WALK_MOVE( ENT( pev ), 0, 0, WALKMOVE_NORMAL ) ) { 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 From f20b7259f3687cf01a4e6dd4944214ac44e6b2ff Mon Sep 17 00:00:00 2001 From: Andrey Akhmichin Date: Sat, 1 Aug 2020 20:26:28 +0500 Subject: [PATCH 06/16] wscript: reorder sources list. --- cl_dll/wscript | 95 ++++++++++++++++++++++++++++-------- dlls/wscript | 130 ++++++++++++++++++++++++++++++++++++++++--------- 2 files changed, 183 insertions(+), 42 deletions(-) diff --git a/cl_dll/wscript b/cl_dll/wscript index 3bc40d56..9b8c0acc 100644 --- a/cl_dll/wscript +++ b/cl_dll/wscript @@ -14,33 +14,88 @@ def configure(conf): conf.check_cc(lib='dl') if conf.env.DEST_OS == 'win32': - conf.check_cxx( lib='user32' ) + conf.check_cxx(lib='user32') def build(bld): source = bld.path.parent.ant_glob([ - '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', - 'dlls/shotgun.cpp', 'dlls/squeakgrenade.cpp', 'dlls/tripmine.cpp', 'dlls/glock.cpp' + 'pm_shared/*.c' + ]) + source += bld.path.ant_glob([ + 'hl/*.cpp' + ]) + source += bld.path.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 += [ - 'ev_hldm.cpp', 'ammo.cpp', 'ammo_secondary.cpp', 'ammohistory.cpp', - 'battery.cpp', 'cdll_int.cpp', 'com_weapons.cpp', 'death.cpp', - 'demo.cpp', 'entity.cpp', 'ev_common.cpp', 'events.cpp', - 'flashlight.cpp', 'GameStudioModelRenderer.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', - 'status_icons.cpp', 'statusbar.cpp', 'studio_util.cpp', - 'StudioModelRenderer.cpp', 'text_message.cpp', 'train.cpp', - 'tri.cpp', 'util.cpp', 'view.cpp', 'scoreboard.cpp', 'MOTD.cpp' + 'GameStudioModelRenderer.cpp', + 'MOTD.cpp', + 'StudioModelRenderer.cpp', + 'ammo.cpp', + 'ammo_secondary.cpp', + 'ammohistory.cpp', + 'battery.cpp', + 'cdll_int.cpp', + 'com_weapons.cpp', + 'death.cpp', + 'demo.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', + '../dlls/wpn_shared', + '../common', + '../engine', + '../pm_shared', + '../game_shared', + '../public', + '../utils/false_vgui/include' + ] defines = ['CLIENT_DLL'] if bld.env.GOLDSRC: diff --git a/dlls/wscript b/dlls/wscript index 2a469153..5f17aefc 100644 --- a/dlls/wscript +++ b/dlls/wscript @@ -27,28 +27,106 @@ def build(bld): ]) source += [ - 'agrunt.cpp', 'airtank.cpp', 'aflock.cpp', 'animating.cpp', 'animation.cpp', 'apache.cpp', - 'barnacle.cpp', 'barney.cpp', 'bigmomma.cpp', 'bloater.cpp', 'bmodels.cpp', 'bullsquid.cpp', 'buttons.cpp', - 'cbase.cpp', 'client.cpp', 'combat.cpp', 'controller.cpp', 'crossbow.cpp', 'crowbar.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', + 'agrunt.cpp', + 'airtank.cpp', + 'aflock.cpp', + 'animating.cpp', + 'animation.cpp', + 'apache.cpp', + 'barnacle.cpp', + 'barney.cpp', + 'bigmomma.cpp', + 'bloater.cpp', + 'bmodels.cpp', + 'bullsquid.cpp', + 'buttons.cpp', + 'cbase.cpp', + 'client.cpp', + 'combat.cpp', + 'controller.cpp', + 'crossbow.cpp', + 'crowbar.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', - 'weapons.cpp', 'world.cpp', 'xen.cpp', 'zombie.cpp'] + 'weapons.cpp', + 'world.cpp', + 'xen.cpp', + 'zombie.cpp' + ] if bld.env.VOICEMGR: source += bld.path.parent.ant_glob([ @@ -57,7 +135,15 @@ def build(bld): else: defines += ['NO_VOICEGAMEMGR'] - includes = Utils.to_list('. wpn_shared ../common ../engine ../pm_shared ../game_shared ../public') + includes = [ + '.', + 'wpn_shared', + '../common', + '../engine', + '../pm_shared', + '../game_shared', + '../public' + ] libs = [] From 2254a16b7bfb2cf5e030887a8a296d6234f6e970 Mon Sep 17 00:00:00 2001 From: Andrey Akhmichin Date: Sun, 2 Aug 2020 20:23:29 +0500 Subject: [PATCH 07/16] client: wscript: update. --- cl_dll/wscript | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cl_dll/wscript b/cl_dll/wscript index 9b8c0acc..b7bf76e9 100644 --- a/cl_dll/wscript +++ b/cl_dll/wscript @@ -23,7 +23,7 @@ def build(bld): source += bld.path.ant_glob([ 'hl/*.cpp' ]) - source += bld.path.ant_glob([ + source += bld.path.parent.ant_glob([ 'dlls/crossbow.cpp', 'dlls/crowbar.cpp', 'dlls/egon.cpp', From 8e4ded4017827a60a49885c98f43cda06bc61ab3 Mon Sep 17 00:00:00 2001 From: Andrey Akhmichin Date: Sun, 9 Aug 2020 03:29:46 +0500 Subject: [PATCH 08/16] wscript: update yet again. --- cl_dll/wscript | 2 +- dlls/wscript | 19 ++++++++++--------- wscript | 4 ++++ 3 files changed, 15 insertions(+), 10 deletions(-) diff --git a/cl_dll/wscript b/cl_dll/wscript index b7bf76e9..f02742b7 100644 --- a/cl_dll/wscript +++ b/cl_dll/wscript @@ -88,7 +88,6 @@ def build(bld): '.', 'hl/', '../dlls', - '../dlls/wpn_shared', '../common', '../engine', '../pm_shared', @@ -125,3 +124,4 @@ def build(bld): subsystem = bld.env.MSVC_SUBSYSTEM, idx = bld.get_taskgen_count() ) + diff --git a/dlls/wscript b/dlls/wscript index 5f17aefc..33d37185 100644 --- a/dlls/wscript +++ b/dlls/wscript @@ -21,7 +21,6 @@ def configure(conf): conf.fatal("Could not find hl.def") def build(bld): - defines = [] source = bld.path.parent.ant_glob([ 'pm_shared/*.c', ]) @@ -128,16 +127,8 @@ def build(bld): 'zombie.cpp' ] - if bld.env.VOICEMGR: - source += bld.path.parent.ant_glob([ - 'game_shared/voice_gamemgr.cpp', - ]) - else: - defines += ['NO_VOICEGAMEMGR'] - includes = [ '.', - 'wpn_shared', '../common', '../engine', '../pm_shared', @@ -145,6 +136,15 @@ def build(bld): '../public' ] + defines = [] + + if bld.env.VOICEMGR: + source += bld.path.parent.ant_glob([ + 'game_shared/voice_gamemgr.cpp', + ]) + else: + defines += ['NO_VOICEGAMEMGR'] + libs = [] if bld.env.DEST_OS not in ['android', 'dos']: @@ -164,3 +164,4 @@ def build(bld): subsystem = bld.env.MSVC_SUBSYSTEM, idx = bld.get_taskgen_count() ) + diff --git a/wscript b/wscript index b01647df..3e892ff1 100644 --- a/wscript +++ b/wscript @@ -271,6 +271,10 @@ def configure(conf): conf.env.cxxshlib_PATTERN = conf.env.cxxshlib_PATTERN[3:] conf.define('CLIENT_WEAPONS', '1') + conf.define('CROWBAR_IDLE_ANIM', '0') + conf.define('CROWBAR_DELAY_FIX', '0') + conf.define('CROWBAR_FIX_RAPID_CROWBAR', '0') + conf.define('GAUSS_OVERCHARGE_FIX', '0') if conf.env.DEST_OS == 'android' or conf.options.ENABLE_MOD_HACKS: conf.define('MOBILE_HACKS', '1') From d7509365f007490a64fe3c7329123d1364e4d083 Mon Sep 17 00:00:00 2001 From: Andrey Akhmichin Date: Sun, 9 Aug 2020 22:23:16 +0500 Subject: [PATCH 09/16] wscript: Fix compilation. --- wscript | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/wscript b/wscript index 3e892ff1..b08bd906 100644 --- a/wscript +++ b/wscript @@ -271,10 +271,10 @@ def configure(conf): conf.env.cxxshlib_PATTERN = conf.env.cxxshlib_PATTERN[3:] conf.define('CLIENT_WEAPONS', '1') - conf.define('CROWBAR_IDLE_ANIM', '0') - conf.define('CROWBAR_DELAY_FIX', '0') - conf.define('CROWBAR_FIX_RAPID_CROWBAR', '0') - conf.define('GAUSS_OVERCHARGE_FIX', '0') + 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: conf.define('MOBILE_HACKS', '1') From efe13c3d0419db6427c31a07164c8541cfe77c08 Mon Sep 17 00:00:00 2001 From: Agent Agrimar Date: Sun, 13 Sep 2020 05:58:45 -0400 Subject: [PATCH 10/16] client: wscript: add winmm.lib dependency This fixes a linker error when compiling for win32 with Goldsrc Support enabled. --- cl_dll/wscript | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/cl_dll/wscript b/cl_dll/wscript index f02742b7..07dabf08 100644 --- a/cl_dll/wscript +++ b/cl_dll/wscript @@ -10,12 +10,15 @@ def options(opt): return def configure(conf): - if conf.env.GOLDSRC and conf.env.DEST_OS != 'win32': - conf.check_cc(lib='dl') - if conf.env.DEST_OS == 'win32': 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): source = bld.path.parent.ant_glob([ 'pm_shared/*.c' @@ -101,12 +104,15 @@ def build(bld): defines += ['GOLDSOURCE_SUPPORT'] libs = [] - if bld.env.GOLDSRC and bld.env.DEST_OS != 'win32': - libs += ['DL'] - if bld.env.DEST_OS == 'win32': 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']: install_path = os.path.join(bld.env.GAMEDIR, bld.env.CLIENT_DIR) else: From a39583f1ef2c435aa598fb5ce30c4571e1340e20 Mon Sep 17 00:00:00 2001 From: Agent Agrimar Date: Sun, 13 Sep 2020 08:01:53 -0400 Subject: [PATCH 11/16] client: cmake: add winmm.lib dependency This fixes a linker error when compiling for win32 with Goldsrc Support enabled. --- cl_dll/CMakeLists.txt | 3 +++ 1 file changed, 3 insertions(+) diff --git a/cl_dll/CMakeLists.txt b/cl_dll/CMakeLists.txt index cde35d14..b7c98330 100644 --- a/cl_dll/CMakeLists.txt +++ b/cl_dll/CMakeLists.txt @@ -132,6 +132,9 @@ endif() if(WIN32) target_link_libraries( ${CLDLL_LIBRARY} user32.lib ) + if (GOLDSOURCE_SUPPORT) + target_link_libraries( ${CLDLL_LIBRARY} winmm.lib ) + endif() endif() set_target_properties (${CLDLL_LIBRARY} PROPERTIES From dbd9b1c698f00bf132d8ddbf51c06a64970eb55c Mon Sep 17 00:00:00 2001 From: Alibek Omarov Date: Mon, 28 Sep 2020 16:21:15 +0300 Subject: [PATCH 12/16] public: build: add ARMv8 32-bit support, in case of someone actually uses it --- cmake/LibraryNaming.cmake | 8 +++++--- public/build.h | 17 +++++++++-------- scripts/waifulib/library_naming.py | 12 +++++++----- 3 files changed, 21 insertions(+), 16 deletions(-) diff --git a/cmake/LibraryNaming.cmake b/cmake/LibraryNaming.cmake index 22581078..f4e3d4b0 100644 --- a/cmake/LibraryNaming.cmake +++ b/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_APPLE "build.h" XASH_APPLE) 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_SOFTFP "build.h" XASH_ARM_SOFTFP) check_symbol_exists(XASH_ARMv4 "build.h" XASH_ARMv4) check_symbol_exists(XASH_ARMv5 "build.h" XASH_ARMv5) check_symbol_exists(XASH_ARMv6 "build.h" XASH_ARMv6) 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_BSD "build.h" XASH_BSD) check_symbol_exists(XASH_E2K "build.h" XASH_E2K) @@ -55,11 +55,13 @@ if(XASH_AMD64) set(BUILDARCH "amd64") elseif(XASH_X86) set(BUILDARCH "") -elseif(XASH_ARM64) +elseif(XASH_ARM AND XASH_64BIT) set(BUILDARCH "arm64") elseif(XASH_ARM) set(BUILDARCH "armv") - if(XASH_ARMv7) + if(XASH_ARMv8) + set(BUILDARCH "${BUILDARCH}8_32") + elseif(XASH_ARMv7) set(BUILDARCH "${BUILDARCH}7") elseif(XASH_ARMv6) set(BUILDARCH "${BUILDARCH}6") diff --git a/public/build.h b/public/build.h index a087c22c..043a11cd 100644 --- a/public/build.h +++ b/public/build.h @@ -45,13 +45,13 @@ For more information, please refer to #undef XASH_ANDROID #undef XASH_APPLE #undef XASH_ARM -#undef XASH_ARM64 #undef XASH_ARM_HARDFP #undef XASH_ARM_SOFTFP #undef XASH_ARMv4 #undef XASH_ARMv5 #undef XASH_ARMv6 #undef XASH_ARMv7 +#undef XASH_ARMv8 //#undef XASH_BIG_ENDIAN #undef XASH_BSD #undef XASH_E2K @@ -169,14 +169,13 @@ For more information, please refer to #define XASH_AMD64 1 #elif defined(__i386__) || defined(_X86_) || defined(_M_IX86) #define XASH_X86 1 -#elif defined __aarch64__ +#elif defined __aarch64__ || defined _M_ARM64 #define XASH_64BIT 1 - #define XASH_ARM64 1 + #define XASH_ARM 8 #elif defined __arm__ || defined _M_ARM - #if defined _M_ARM - // msvc can only armv7 ? - #define XASH_ARM 7 - #elif __ARM_ARCH == 7 || __ARM_ARCH_7__ + #if __ARM_ARCH == 8 || __ARM_ARCH_8__ + #define XASH_ARM 8 + #elif __ARM_ARCH == 7 || __ARM_ARCH_7__ || defined _M_ARM // msvc can only armv7 in 32 bit #define XASH_ARM 7 #elif __ARM_ARCH == 6 || __ARM_ARCH_6__ || __ARM_ARCH_6J__ #define XASH_ARM 6 @@ -212,7 +211,9 @@ For more information, please refer to #define XASH_64BIT 1 #endif -#if XASH_ARM == 7 +#if XASH_ARM == 8 + #define XASH_ARMv8 1 +#elif XASH_ARM == 7 #define XASH_ARMv7 1 #elif XASH_ARM == 6 #define XASH_ARMv6 1 diff --git a/scripts/waifulib/library_naming.py b/scripts/waifulib/library_naming.py index 827ef76c..6ee9a725 100644 --- a/scripts/waifulib/library_naming.py +++ b/scripts/waifulib/library_naming.py @@ -25,13 +25,13 @@ DEFINES = [ 'XASH_ANDROID', 'XASH_APPLE', 'XASH_ARM', -'XASH_ARM64', 'XASH_ARM_HARDFP', 'XASH_ARM_SOFTFP', 'XASH_ARMv4', 'XASH_ARMv5', 'XASH_ARMv6', 'XASH_ARMv7', +'XASH_ARMv8', 'XASH_BIG_ENDIAN', 'XASH_BSD', 'XASH_E2K', @@ -61,9 +61,9 @@ def configure(conf): 'fragment': CHECK_SYMBOL_EXISTS_FRAGMENT % (x, x), 'includes': [conf.path.find_node('public/').abspath()], 'define_name': x }, DEFINES ) - + conf.multicheck(*tests, msg = '', mandatory = False, quiet = True) - + # engine/common/build.c if conf.env.XASH_ANDROID: buildos = "android" @@ -87,11 +87,13 @@ def configure(conf): buildarch = "amd64" elif conf.env.XASH_X86: buildarch = "" - elif conf.env.XASH_ARM64: + elif conf.env.XASH_ARM and conf.env.XASH_64BIT: buildarch = "arm64" elif conf.env.XASH_ARM: buildarch = "armv" - if conf.env.XASH_ARMv7: + if conf.env.XASH_ARMv8: + buildarch += "8_32" + elif conf.env.XASH_ARMv7: buildarch += "7" elif conf.env.XASH_ARMv6: buildarch += "6" From 4be53d8527eee1d3b56e7f505faba7cefbcb5dac Mon Sep 17 00:00:00 2001 From: Logan Date: Sat, 10 Oct 2020 13:06:04 -0400 Subject: [PATCH 13/16] server: fix monster yaw speed (#137) This makes the yaw speed for all monsters (scientists, headcrabs, etc.) framerate independent. Fix by Solokiller with mikela-valve's adjustments: https://github.com/ValveSoftware/halflife/issues/2458 --- dlls/basemonster.h | 4 ++++ dlls/monsters.cpp | 16 ++++++++++++++++ wscript | 1 + 3 files changed, 21 insertions(+) diff --git a/dlls/basemonster.h b/dlls/basemonster.h index 2234aaf9..48ac9fc9 100644 --- a/dlls/basemonster.h +++ b/dlls/basemonster.h @@ -328,5 +328,9 @@ public: BOOL CineCleanup(); CBaseEntity* DropItem( const char *pszItemName, const Vector &vecPos, const Vector &vecAng );// drop an item. + +#ifdef MONSTER_YAWSPEED_FIX + float m_flLastYawTime; +#endif }; #endif // BASEMONSTER_H diff --git a/dlls/monsters.cpp b/dlls/monsters.cpp index 57de767d..1192b8ca 100644 --- a/dlls/monsters.cpp +++ b/dlls/monsters.cpp @@ -2022,6 +2022,10 @@ void CBaseMonster::MonsterInit( void ) SetThink( &CBaseMonster::MonsterInitThink ); pev->nextthink = gpGlobals->time + 0.1f; SetUse( &CBaseMonster::MonsterUse ); + +#ifdef MONSTER_YAWSPEED_FIX + m_flLastYawTime = gpGlobals->time; +#endif } //========================================================= @@ -2504,7 +2508,15 @@ float CBaseMonster::ChangeYaw( int yawSpeed ) ideal = pev->ideal_yaw; if( current != ideal ) { +#ifdef MONSTER_YAWSPEED_FIX + float delta = gpGlobals->time - m_flLastYawTime; + if( delta > 0.25 ) + delta = 0.25; + + speed = (float)yawSpeed * delta * 2; +#else speed = (float)yawSpeed * gpGlobals->frametime * 10; +#endif move = ideal - current; if( ideal > current ) @@ -2548,6 +2560,10 @@ float CBaseMonster::ChangeYaw( int yawSpeed ) else move = 0; +#ifdef MONSTER_YAWSPEED_FIX + m_flLastYawTime = gpGlobals->time; +#endif + return move; } diff --git a/wscript b/wscript index b08bd906..9c0aba5f 100644 --- a/wscript +++ b/wscript @@ -275,6 +275,7 @@ def configure(conf): conf.define('CROWBAR_DELAY_FIX', False) conf.define('CROWBAR_FIX_RAPID_CROWBAR', False) conf.define('GAUSS_OVERCHARGE_FIX', False) + conf.define('MONSTER_YAWSPEED_FIX', False) if conf.env.DEST_OS == 'android' or conf.options.ENABLE_MOD_HACKS: conf.define('MOBILE_HACKS', '1') From 47c13ef87305d53600af75aa3c7d4d4ffe192641 Mon Sep 17 00:00:00 2001 From: Andrey Akhmichin Date: Sat, 10 Oct 2020 22:43:04 +0500 Subject: [PATCH 14/16] server: Use separate cvar instead of macro for monster yaw speed fix. --- dlls/basemonster.h | 2 -- dlls/game.cpp | 2 ++ dlls/game.h | 1 + dlls/monsters.cpp | 22 ++++++++++------------ wscript | 1 - 5 files changed, 13 insertions(+), 15 deletions(-) diff --git a/dlls/basemonster.h b/dlls/basemonster.h index 48ac9fc9..a5f7f459 100644 --- a/dlls/basemonster.h +++ b/dlls/basemonster.h @@ -329,8 +329,6 @@ public: CBaseEntity* DropItem( const char *pszItemName, const Vector &vecPos, const Vector &vecAng );// drop an item. -#ifdef MONSTER_YAWSPEED_FIX float m_flLastYawTime; -#endif }; #endif // BASEMONSTER_H diff --git a/dlls/game.cpp b/dlls/game.cpp index c48b44b3..99a959f0 100644 --- a/dlls/game.cpp +++ b/dlls/game.cpp @@ -35,6 +35,7 @@ cvar_t weaponstay = { "mp_weaponstay","0", FCVAR_SERVER }; cvar_t selfgauss = { "mp_selfgauss", "1", FCVAR_SERVER }; cvar_t chargerfix = { "mp_chargerfix", "0", FCVAR_SERVER }; cvar_t satchelfix = { "mp_satchelfix", "0", FCVAR_SERVER }; +cvar_t monsteryawspeedfix = { "monsteryawspeedfix", "0", FCVAR_SERVER }; cvar_t forcerespawn = { "mp_forcerespawn","1", FCVAR_SERVER }; cvar_t flashlight = { "mp_flashlight","0", FCVAR_SERVER }; cvar_t aimcrosshair = { "mp_autocrosshair","1", FCVAR_SERVER }; @@ -482,6 +483,7 @@ void GameDLLInit( void ) CVAR_REGISTER( &selfgauss ); CVAR_REGISTER( &chargerfix ); CVAR_REGISTER( &satchelfix ); + CVAR_REGISTER( &monsteryawspeedfix ); CVAR_REGISTER( &forcerespawn ); CVAR_REGISTER( &flashlight ); CVAR_REGISTER( &aimcrosshair ); diff --git a/dlls/game.h b/dlls/game.h index 026070ff..e60cb4da 100644 --- a/dlls/game.h +++ b/dlls/game.h @@ -30,6 +30,7 @@ extern cvar_t weaponstay; extern cvar_t selfgauss; extern cvar_t chargerfix; extern cvar_t satchelfix; +extern cvar_t monsteryawspeedfix; extern cvar_t forcerespawn; extern cvar_t flashlight; extern cvar_t aimcrosshair; diff --git a/dlls/monsters.cpp b/dlls/monsters.cpp index 1192b8ca..ab82cca5 100644 --- a/dlls/monsters.cpp +++ b/dlls/monsters.cpp @@ -2023,9 +2023,7 @@ void CBaseMonster::MonsterInit( void ) pev->nextthink = gpGlobals->time + 0.1f; SetUse( &CBaseMonster::MonsterUse ); -#ifdef MONSTER_YAWSPEED_FIX m_flLastYawTime = gpGlobals->time; -#endif } //========================================================= @@ -2508,15 +2506,17 @@ float CBaseMonster::ChangeYaw( int yawSpeed ) ideal = pev->ideal_yaw; if( current != ideal ) { -#ifdef MONSTER_YAWSPEED_FIX - float delta = gpGlobals->time - m_flLastYawTime; - if( delta > 0.25 ) - delta = 0.25; + 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; - speed = (float)yawSpeed * delta * 2; -#else - speed = (float)yawSpeed * gpGlobals->frametime * 10; -#endif move = ideal - current; if( ideal > current ) @@ -2560,9 +2560,7 @@ float CBaseMonster::ChangeYaw( int yawSpeed ) else move = 0; -#ifdef MONSTER_YAWSPEED_FIX m_flLastYawTime = gpGlobals->time; -#endif return move; } diff --git a/wscript b/wscript index 9c0aba5f..b08bd906 100644 --- a/wscript +++ b/wscript @@ -275,7 +275,6 @@ def configure(conf): conf.define('CROWBAR_DELAY_FIX', False) conf.define('CROWBAR_FIX_RAPID_CROWBAR', False) conf.define('GAUSS_OVERCHARGE_FIX', False) - conf.define('MONSTER_YAWSPEED_FIX', False) if conf.env.DEST_OS == 'android' or conf.options.ENABLE_MOD_HACKS: conf.define('MOBILE_HACKS', '1') From 2de25090948b64d2ebbe9d2ae7d5a1b90f60b182 Mon Sep 17 00:00:00 2001 From: Andrey Akhmichin Date: Sat, 10 Oct 2020 22:45:28 +0500 Subject: [PATCH 15/16] server: remove "mp_" prefix for non-multiplayer cvars. --- dlls/game.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/dlls/game.cpp b/dlls/game.cpp index 99a959f0..72d0b75f 100644 --- a/dlls/game.cpp +++ b/dlls/game.cpp @@ -32,9 +32,9 @@ cvar_t timelimit = { "mp_timelimit","0", FCVAR_SERVER }; cvar_t friendlyfire = { "mp_friendlyfire","0", FCVAR_SERVER }; cvar_t falldamage = { "mp_falldamage","0", FCVAR_SERVER }; cvar_t weaponstay = { "mp_weaponstay","0", FCVAR_SERVER }; -cvar_t selfgauss = { "mp_selfgauss", "1", FCVAR_SERVER }; -cvar_t chargerfix = { "mp_chargerfix", "0", FCVAR_SERVER }; -cvar_t satchelfix = { "mp_satchelfix", "0", FCVAR_SERVER }; +cvar_t selfgauss = { "selfgauss", "1", FCVAR_SERVER }; +cvar_t chargerfix = { "chargerfix", "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 flashlight = { "mp_flashlight","0", FCVAR_SERVER }; From 2a264d2c9a33ebbe122364b4faaf2bbac31e5fab Mon Sep 17 00:00:00 2001 From: Andrey Akhmichin Date: Sun, 11 Oct 2020 00:08:47 +0500 Subject: [PATCH 16/16] Add the latest steam changes for cl_autowepswitch cvar. --- dlls/multiplay_gamerules.cpp | 12 ++++++++++++ dlls/player.cpp | 2 -- dlls/singleplay_gamerules.cpp | 6 ++++++ 3 files changed, 18 insertions(+), 2 deletions(-) diff --git a/dlls/multiplay_gamerules.cpp b/dlls/multiplay_gamerules.cpp index 90dc4f3b..5a4b14e0 100644 --- a/dlls/multiplay_gamerules.cpp +++ b/dlls/multiplay_gamerules.cpp @@ -324,6 +324,12 @@ BOOL CHalfLifeMultiplay::FShouldSwitchWeapon( CBasePlayer *pPlayer, CBasePlayerI return FALSE; } + if( pPlayer->m_iAutoWepSwitch == 2 + && pPlayer->m_afButtonLast & ( IN_ATTACK | IN_ATTACK2 ) ) + { + return FALSE; + } + if( !pPlayer->m_pActiveItem->CanHolster() ) { // can't put away the active item. @@ -573,7 +579,11 @@ void CHalfLifeMultiplay::PlayerSpawn( CBasePlayer *pPlayer ) { BOOL addDefault; CBaseEntity *pWeaponEntity = NULL; + int iOldAutoWepSwitch; + + iOldAutoWepSwitch = pPlayer->m_iAutoWepSwitch; + pPlayer->m_iAutoWepSwitch = 1; pPlayer->pev->weapons |= ( 1 << WEAPON_SUIT ); addDefault = TRUE; @@ -590,6 +600,8 @@ void CHalfLifeMultiplay::PlayerSpawn( CBasePlayer *pPlayer ) pPlayer->GiveNamedItem( "weapon_9mmhandgun" ); pPlayer->GiveAmmo( 68, "9mm", _9MM_MAX_CARRY );// 4 full reloads } + + pPlayer->m_iAutoWepSwitch = iOldAutoWepSwitch; } //========================================================= diff --git a/dlls/player.cpp b/dlls/player.cpp index 6b741778..fc264cc9 100644 --- a/dlls/player.cpp +++ b/dlls/player.cpp @@ -2876,8 +2876,6 @@ void CBasePlayer::Spawn( void ) m_flNextChatTime = gpGlobals->time; - m_iAutoWepSwitch = 1; - g_pGameRules->PlayerSpawn( this ); } diff --git a/dlls/singleplay_gamerules.cpp b/dlls/singleplay_gamerules.cpp index 7f722e30..ba73747b 100644 --- a/dlls/singleplay_gamerules.cpp +++ b/dlls/singleplay_gamerules.cpp @@ -80,6 +80,12 @@ BOOL CHalfLifeRules::FShouldSwitchWeapon( CBasePlayer *pPlayer, CBasePlayerItem return FALSE; } + if( pPlayer->m_iAutoWepSwitch == 2 + && pPlayer->m_afButtonLast & ( IN_ATTACK | IN_ATTACK2 ) ) + { + return FALSE; + } + if( !pPlayer->m_pActiveItem->CanHolster() ) { return FALSE;