Browse Source

Merge branch 'master' into mobile_hacks

mobile_hacks
Andrey Akhmichin 2 years ago
parent
commit
459d067451
No known key found for this signature in database
GPG Key ID: 1F180D249B0643C0
  1. 113
      .github/workflows/manual.yml
  2. 2
      cl_dll/com_weapons.cpp
  3. 1
      cl_dll/com_weapons.h
  4. 2
      cl_dll/compile.bat
  5. 2
      cl_dll/entity.cpp
  6. 35
      cl_dll/ev_hldm.cpp
  7. 14
      cl_dll/hl/hl_weapons.cpp
  8. 2
      cl_dll/view.cpp
  9. 2
      dlls/buttons.cpp
  10. 9
      dlls/client.cpp
  11. 25
      dlls/player.cpp
  12. 15
      dlls/scientist.cpp
  13. 7
      dlls/tripmine.cpp
  14. 2
      dlls/weapons.cpp
  15. 5
      dlls/weapons.h
  16. 16
      pm_shared/pm_shared.c
  17. 4
      scripts/waifulib/xcompile.py

113
.github/workflows/manual.yml

@ -0,0 +1,113 @@
name: manual build
on:
workflow_dispatch:
inputs:
buildtype:
type: choice
description: Build Type
options:
- Release
- Debug
usevgui:
type: choice
description: Use VGUI
options:
- 'OFF'
- 'ON'
jobs:
build:
runs-on: ${{ matrix.os }}
strategy:
matrix:
include:
- os: ubuntu-latest
cc: gcc
cxx: g++
- os: windows-2019
cc: cl
cxx: cl
env:
CC: ${{ matrix.cc }}
CXX: ${{ matrix.cxx }}
steps:
- name: Checkout
uses: actions/checkout@v2
with:
submodules: recursive
- name: Checkout steam-runtime
if: startsWith(matrix.os, 'ubuntu')
uses: actions/checkout@v2
with:
repository: ValveSoftware/steam-runtime
path: steam-runtime
- name: Cache steam-runtime
if: startsWith(matrix.os, 'ubuntu')
id: cache-steam-runtime
uses: actions/cache@v2
with:
path: com.valvesoftware.SteamRuntime.Sdk-i386-scout-sysroot.tar.gz
key: ${{ runner.os }}-steam-runtime
- name: Download steam-runtime
if: startsWith(matrix.os, 'ubuntu') && steps.cache-steam-runtime.outputs.cache-hit != 'true'
run: wget --no-verbose https://repo.steampowered.com/steamrt-images-scout/snapshots/0.20210610.0/com.valvesoftware.SteamRuntime.Sdk-i386-scout-sysroot.tar.gz
- name: Install steam runtime
if: startsWith(matrix.os, 'ubuntu')
run: |
sudo apt update
./steam-runtime/setup_chroot.sh --i386 --tarball ./com.valvesoftware.SteamRuntime.Sdk-i386-scout-sysroot.tar.gz
sudo sed -i 's/groups=sudo/groups=adm/g' /etc/schroot/chroot.d/steamrt_scout_i386.conf
- name: Copy vgui.so
if: ${{ startsWith(matrix.os, 'ubuntu') && github.event.inputs.usevgui == 'ON' }}
run: |
mkdir -p build/cl_dll
cp vgui_support/vgui-dev/lib/vgui.so build/cl_dll
- name: Build on Linux
if: startsWith(matrix.os, 'ubuntu')
run: |
schroot --chroot steamrt_scout_i386 -- cmake -B build -S . -DCMAKE_EXE_LINKER_FLAGS="-Wl,--no-undefined" -DCMAKE_BUILD_TYPE=${{ github.event.inputs.buildtype }} -DCMAKE_INSTALL_PREFIX="$PWD/dist" -DUSE_VGUI=${{ github.event.inputs.usevgui }}
schroot --chroot steamrt_scout_i386 -- cmake --build build --target all
schroot --chroot steamrt_scout_i386 -- cmake --build build --target install
- name: Add msbuild to PATH
if: startsWith(matrix.os, 'windows')
uses: microsoft/setup-msbuild@v1.0.2
- name: Build on Windows
if: startsWith(matrix.os, 'windows')
run: |
cmake -G "Visual Studio 16 2019" -A Win32 -B build -DCMAKE_INSTALL_PREFIX="dist" -DUSE_VGUI=${{ github.event.inputs.usevgui }}
msbuild -verbosity:normal /property:Configuration=${{ github.event.inputs.buildtype }} build/INSTALL.vcxproj
- name: Extract branch name
shell: bash
run: echo "##[set-output name=branch;]$(echo ${GITHUB_REF#refs/heads/} | tr '/' '_')"
id: extract_branch
- name: Extract gamedir
shell: bash
run: echo "##[set-output name=gamedir;]$(grep build/CMakeCache.txt -Ee 'GAMEDIR:STRING=[a-z]+' | cut -d '=' -f 2)"
id: extract_gamedir
- name: Copy pdbs to dist dir
if: ${{ startsWith(matrix.os, 'windows') && github.event.inputs.buildtype == 'Debug' }}
run: |
copy build/cl_dll/Debug/client.pdb dist/${{ steps.extract_gamedir.outputs.gamedir }}/cl_dlls/
copy build/dlls/Debug/hl.pdb dist/${{ steps.extract_gamedir.outputs.gamedir }}/dlls/
- name: Delete .lib files from dist
if: startsWith(matrix.os, 'windows')
run: |
Remove-Item -Force -Path dist/${{ steps.extract_gamedir.outputs.gamedir }}/cl_dlls/client.lib
Remove-Item -Force -Path dist/${{ steps.extract_gamedir.outputs.gamedir }}/dlls/hl.lib
- name: Upload linux artifact
if: startsWith(matrix.os, 'ubuntu')
uses: actions/upload-artifact@v2
with:
name: hlsdk-${{ steps.extract_branch.outputs.branch }}-linux
path: dist/${{ steps.extract_gamedir.outputs.gamedir }}
- name: Upload windows artifact
if: startsWith(matrix.os, 'windows')
uses: actions/upload-artifact@v2
with:
name: hlsdk-${{ steps.extract_branch.outputs.branch }}-windows
path: dist/${{ steps.extract_gamedir.outputs.gamedir }}

2
cl_dll/com_weapons.cpp

@ -137,7 +137,7 @@ void HUD_PlaybackEvent( int flags, const edict_t *pInvoker, unsigned short event
// Weapon prediction events are assumed to occur at the player's origin // Weapon prediction events are assumed to occur at the player's origin
org = g_finalstate->playerstate.origin; org = g_finalstate->playerstate.origin;
ang = v_angles; ang = v_client_aimangles;
gEngfuncs.pfnPlaybackEvent( flags, pInvoker, eventindex, delay, org, ang, fparam1, fparam2, iparam1, iparam2, bparam1, bparam2 ); gEngfuncs.pfnPlaybackEvent( flags, pInvoker, eventindex, delay, org, ang, fparam1, fparam2, iparam1, iparam2, bparam1, bparam2 );
} }

1
cl_dll/com_weapons.h

@ -39,6 +39,7 @@ extern cvar_t *cl_lw;
extern int g_runfuncs; extern int g_runfuncs;
extern vec3_t v_angles; extern vec3_t v_angles;
extern vec3_t v_client_aimangles;
extern float g_lastFOV; extern float g_lastFOV;
extern struct local_state_s *g_finalstate; extern struct local_state_s *g_finalstate;
#endif #endif

2
cl_dll/compile.bat

@ -7,7 +7,7 @@ set PATH=%MSVCDir%\VC98\Bin;%MSVCDir%\Common\MSDev98\Bin\;%PATH%
echo -- Compiler is MSVC6 echo -- Compiler is MSVC6
set XASH3DSRC=..\..\Xash3D_original set XASH3DSRC=..\..\Xash3D_original
set INCLUDES=-I../common -I../engine -I../pm_shared -I../game_shared -I../public -I../external -I../dlls -I../utils/false_vgui/include set INCLUDES=-I../common -I../engine -I../pm_shared -I../game_shared -I../public -I../external -I../dlls -I../utils/fake_vgui/include
set SOURCES=../dlls/crossbow.cpp ^ set SOURCES=../dlls/crossbow.cpp ^
../dlls/crowbar.cpp ^ ../dlls/crowbar.cpp ^
../dlls/egon.cpp ^ ../dlls/egon.cpp ^

2
cl_dll/entity.cpp

@ -222,7 +222,7 @@ void DLLEXPORT HUD_TxferPredictionData( struct entity_state_s *ps, const struct
VectorCopy( ppcd->vuser3, pcd->vuser3 ); VectorCopy( ppcd->vuser3, pcd->vuser3 );
VectorCopy( ppcd->vuser4, pcd->vuser4 ); VectorCopy( ppcd->vuser4, pcd->vuser4 );
memcpy( wd, pwd, 32 * sizeof(weapon_data_t) ); memcpy( wd, pwd, MAX_WEAPONS * sizeof(weapon_data_t) );
} }
/* /*

35
cl_dll/ev_hldm.cpp

@ -486,7 +486,7 @@ static void EV_FireGlock_Impl( event_args_t *args )
if( EV_IsLocal( idx ) ) if( EV_IsLocal( idx ) )
{ {
EV_MuzzleFlash(); EV_MuzzleFlash();
gEngfuncs.pEventAPI->EV_WeaponAnimation( empty ? GLOCK_SHOOT_EMPTY : GLOCK_SHOOT, 2 ); gEngfuncs.pEventAPI->EV_WeaponAnimation( empty ? GLOCK_SHOOT_EMPTY : GLOCK_SHOOT, 0 );
V_PunchAxis( 0, -2.0 ); V_PunchAxis( 0, -2.0 );
} }
@ -549,7 +549,7 @@ void EV_FireShotGunDouble( event_args_t *args )
{ {
// Add muzzle flash to current weapon model // Add muzzle flash to current weapon model
EV_MuzzleFlash(); EV_MuzzleFlash();
gEngfuncs.pEventAPI->EV_WeaponAnimation( SHOTGUN_FIRE2, 2 ); gEngfuncs.pEventAPI->EV_WeaponAnimation( SHOTGUN_FIRE2, 0 );
V_PunchAxis( 0, -10.0 ); V_PunchAxis( 0, -10.0 );
} }
@ -603,7 +603,7 @@ void EV_FireShotGunSingle( event_args_t *args )
{ {
// Add muzzle flash to current weapon model // Add muzzle flash to current weapon model
EV_MuzzleFlash(); EV_MuzzleFlash();
gEngfuncs.pEventAPI->EV_WeaponAnimation( SHOTGUN_FIRE, 2 ); gEngfuncs.pEventAPI->EV_WeaponAnimation( SHOTGUN_FIRE, 0 );
V_PunchAxis( 0, -5.0 ); V_PunchAxis( 0, -5.0 );
} }
@ -660,7 +660,7 @@ void EV_FireMP5( event_args_t *args )
{ {
// Add muzzle flash to current weapon model // Add muzzle flash to current weapon model
EV_MuzzleFlash(); EV_MuzzleFlash();
gEngfuncs.pEventAPI->EV_WeaponAnimation( MP5_FIRE1 + gEngfuncs.pfnRandomLong( 0, 2 ), 2 ); gEngfuncs.pEventAPI->EV_WeaponAnimation( MP5_FIRE1 + gEngfuncs.pfnRandomLong( 0, 2 ), 0 );
V_PunchAxis( 0, gEngfuncs.pfnRandomFloat( -2, 2 ) ); V_PunchAxis( 0, gEngfuncs.pfnRandomFloat( -2, 2 ) );
} }
@ -697,7 +697,7 @@ void EV_FireMP52( event_args_t *args )
if( EV_IsLocal( idx ) ) if( EV_IsLocal( idx ) )
{ {
gEngfuncs.pEventAPI->EV_WeaponAnimation( MP5_LAUNCH, 2 ); gEngfuncs.pEventAPI->EV_WeaponAnimation( MP5_LAUNCH, 0 );
V_PunchAxis( 0, -10 ); V_PunchAxis( 0, -10 );
} }
@ -862,7 +862,7 @@ void EV_FireGauss( event_args_t *args )
if( EV_IsLocal( idx ) ) if( EV_IsLocal( idx ) )
{ {
V_PunchAxis( 0.0f, -2.0f ); V_PunchAxis( 0.0f, -2.0f );
gEngfuncs.pEventAPI->EV_WeaponAnimation( GAUSS_FIRE2, 2 ); gEngfuncs.pEventAPI->EV_WeaponAnimation( GAUSS_FIRE2, 0 );
if( m_fPrimaryFire == false ) if( m_fPrimaryFire == false )
g_flApplyVel = flDamage; g_flApplyVel = flDamage;
@ -1129,13 +1129,13 @@ void EV_Crowbar( event_args_t *args )
switch( (g_iSwing++) % 3 ) switch( (g_iSwing++) % 3 )
{ {
case 0: case 0:
gEngfuncs.pEventAPI->EV_WeaponAnimation( CROWBAR_ATTACK1MISS, 1 ); gEngfuncs.pEventAPI->EV_WeaponAnimation( CROWBAR_ATTACK1MISS, 0 );
break; break;
case 1: case 1:
gEngfuncs.pEventAPI->EV_WeaponAnimation( CROWBAR_ATTACK2MISS, 1 ); gEngfuncs.pEventAPI->EV_WeaponAnimation( CROWBAR_ATTACK2MISS, 0 );
break; break;
case 2: case 2:
gEngfuncs.pEventAPI->EV_WeaponAnimation( CROWBAR_ATTACK3MISS, 1 ); gEngfuncs.pEventAPI->EV_WeaponAnimation( CROWBAR_ATTACK3MISS, 0 );
break; break;
} }
} }
@ -1203,9 +1203,9 @@ void EV_FireCrossbow2( event_args_t *args )
if( EV_IsLocal( idx ) ) if( EV_IsLocal( idx ) )
{ {
if( args->iparam1 ) if( args->iparam1 )
gEngfuncs.pEventAPI->EV_WeaponAnimation( CROSSBOW_FIRE1, 1 ); gEngfuncs.pEventAPI->EV_WeaponAnimation( CROSSBOW_FIRE1, 0 );
else else
gEngfuncs.pEventAPI->EV_WeaponAnimation( CROSSBOW_FIRE3, 1 ); gEngfuncs.pEventAPI->EV_WeaponAnimation( CROSSBOW_FIRE3, 0 );
} }
// Store off the old count // Store off the old count
@ -1279,9 +1279,9 @@ void EV_FireCrossbow( event_args_t *args )
if( EV_IsLocal( idx ) ) if( EV_IsLocal( idx ) )
{ {
if( args->iparam1 ) if( args->iparam1 )
gEngfuncs.pEventAPI->EV_WeaponAnimation( CROSSBOW_FIRE1, 1 ); gEngfuncs.pEventAPI->EV_WeaponAnimation( CROSSBOW_FIRE1, 0 );
else else
gEngfuncs.pEventAPI->EV_WeaponAnimation( CROSSBOW_FIRE3, 1 ); gEngfuncs.pEventAPI->EV_WeaponAnimation( CROSSBOW_FIRE3, 0 );
V_PunchAxis( 0.0f, -2.0f ); V_PunchAxis( 0.0f, -2.0f );
} }
@ -1321,7 +1321,7 @@ void EV_FireRpg( event_args_t *args )
//Only play the weapon anims if I shot it. //Only play the weapon anims if I shot it.
if( EV_IsLocal( idx ) ) if( EV_IsLocal( idx ) )
{ {
gEngfuncs.pEventAPI->EV_WeaponAnimation( RPG_FIRE2, 1 ); gEngfuncs.pEventAPI->EV_WeaponAnimation( RPG_FIRE2, 0 );
V_PunchAxis( 0, -5.0 ); V_PunchAxis( 0, -5.0 );
} }
@ -1422,7 +1422,7 @@ void EV_EgonFire( event_args_t *args )
//Only play the weapon anims if I shot it. //Only play the weapon anims if I shot it.
if( EV_IsLocal( idx ) ) if( EV_IsLocal( idx ) )
gEngfuncs.pEventAPI->EV_WeaponAnimation( g_fireAnims1[gEngfuncs.pfnRandomLong( 0, 3 )], 1 ); gEngfuncs.pEventAPI->EV_WeaponAnimation( g_fireAnims1[gEngfuncs.pfnRandomLong( 0, 3 )], 0 );
if( iStartup == 1 && EV_IsLocal( idx ) && !( pBeam || pBeam2 || pFlare ) && cl_lw->value ) //Adrian: Added the cl_lw check for those lital people that hate weapon prediction. if( iStartup == 1 && EV_IsLocal( idx ) && !( pBeam || pBeam2 || pFlare ) && cl_lw->value ) //Adrian: Added the cl_lw check for those lital people that hate weapon prediction.
{ {
@ -1564,7 +1564,7 @@ void EV_HornetGunFire( event_args_t *args )
if( EV_IsLocal( idx ) ) if( EV_IsLocal( idx ) )
{ {
V_PunchAxis( 0, gEngfuncs.pfnRandomLong( 0, 2 ) ); V_PunchAxis( 0, gEngfuncs.pfnRandomLong( 0, 2 ) );
gEngfuncs.pEventAPI->EV_WeaponAnimation( HGUN_SHOOT, 1 ); gEngfuncs.pEventAPI->EV_WeaponAnimation( HGUN_SHOOT, 0 );
} }
switch( gEngfuncs.pfnRandomLong( 0, 2 ) ) switch( gEngfuncs.pfnRandomLong( 0, 2 ) )
@ -1609,6 +1609,7 @@ void EV_TripmineFire( event_args_t *args )
pmtrace_t tr; pmtrace_t tr;
idx = args->entindex; idx = args->entindex;
const bool last = args->bparam1 != 0;
VectorCopy( args->origin, vecSrc ); VectorCopy( args->origin, vecSrc );
VectorCopy( args->angles, angles ); VectorCopy( args->angles, angles );
@ -1631,7 +1632,7 @@ void EV_TripmineFire( event_args_t *args )
gEngfuncs.pEventAPI->EV_PlayerTrace( vecSrc, vecSrc + forward * 128.0f, PM_NORMAL, -1, &tr ); gEngfuncs.pEventAPI->EV_PlayerTrace( vecSrc, vecSrc + forward * 128.0f, PM_NORMAL, -1, &tr );
//Hit something solid //Hit something solid
if( tr.fraction < 1.0f ) if( tr.fraction < 1.0f && !last )
gEngfuncs.pEventAPI->EV_WeaponAnimation ( TRIPMINE_DRAW, 0 ); gEngfuncs.pEventAPI->EV_WeaponAnimation ( TRIPMINE_DRAW, 0 );
gEngfuncs.pEventAPI->EV_PopPMStates(); gEngfuncs.pEventAPI->EV_PopPMStates();

14
cl_dll/hl/hl_weapons.cpp

@ -36,7 +36,7 @@ extern globalvars_t *gpGlobals;
extern int g_iUser1; extern int g_iUser1;
// Pool of client side entities/entvars_t // Pool of client side entities/entvars_t
static entvars_t ev[32]; static entvars_t ev[MAX_WEAPONS];
static int num_ents = 0; static int num_ents = 0;
// The entity we'll use to represent the local client // The entity we'll use to represent the local client
@ -45,7 +45,7 @@ static CBasePlayer player;
// Local version of game .dll global variables ( time, etc. ) // Local version of game .dll global variables ( time, etc. )
static globalvars_t Globals; static globalvars_t Globals;
static CBasePlayerWeapon *g_pWpns[32]; static CBasePlayerWeapon *g_pWpns[MAX_WEAPONS];
float g_flApplyVel = 0.0; float g_flApplyVel = 0.0;
int g_irunninggausspred = 0; int g_irunninggausspred = 0;
@ -752,7 +752,7 @@ void HUD_WeaponsPostThink( local_state_s *from, local_state_s *to, usercmd_t *cm
if( !pWeapon ) if( !pWeapon )
return; return;
for( i = 0; i < 32; i++ ) for( i = 0; i < MAX_WEAPONS; i++ )
{ {
pCurrent = g_pWpns[i]; pCurrent = g_pWpns[i];
if( !pCurrent ) if( !pCurrent )
@ -907,11 +907,7 @@ void HUD_WeaponsPostThink( local_state_s *from, local_state_s *to, usercmd_t *cm
// over the wire ( fixes some animation glitches ) // over the wire ( fixes some animation glitches )
if( g_runfuncs && ( HUD_GetWeaponAnim() != to->client.weaponanim ) ) if( g_runfuncs && ( HUD_GetWeaponAnim() != to->client.weaponanim ) )
{ {
int body = 2; int body = 0;
//Pop the model to body 0.
if( pWeapon == &g_Tripmine )
body = 0;
//Show laser sight/scope combo //Show laser sight/scope combo
if( pWeapon == &g_Python && bIsMultiplayer() ) if( pWeapon == &g_Python && bIsMultiplayer() )
@ -921,7 +917,7 @@ void HUD_WeaponsPostThink( local_state_s *from, local_state_s *to, usercmd_t *cm
HUD_SendWeaponAnim( to->client.weaponanim, body, 1 ); HUD_SendWeaponAnim( to->client.weaponanim, body, 1 );
} }
for( i = 0; i < 32; i++ ) for( i = 0; i < MAX_WEAPONS; i++ )
{ {
pCurrent = g_pWpns[i]; pCurrent = g_pWpns[i];

2
cl_dll/view.cpp

@ -88,6 +88,7 @@ float v_cameraFocusAngle = 35.0f;
int v_cameraMode = CAM_MODE_FOCUS; int v_cameraMode = CAM_MODE_FOCUS;
qboolean v_resetCamera = 1; qboolean v_resetCamera = 1;
vec3_t v_client_aimangles;
vec3_t g_ev_punchangle; vec3_t g_ev_punchangle;
cvar_t *scr_ofsx; cvar_t *scr_ofsx;
@ -724,6 +725,7 @@ void V_CalcNormalRefdef( struct ref_params_s *pparams )
// Store off v_angles before munging for third person // Store off v_angles before munging for third person
v_angles = pparams->viewangles; v_angles = pparams->viewangles;
v_client_aimangles = pparams->cl_viewangles;
v_lastAngles = pparams->viewangles; v_lastAngles = pparams->viewangles;
//v_cl_angles = pparams->cl_viewangles; // keep old user mouse angles ! //v_cl_angles = pparams->cl_viewangles; // keep old user mouse angles !
if( CL_IsThirdPerson() ) if( CL_IsThirdPerson() )

2
dlls/buttons.cpp

@ -639,7 +639,7 @@ void CBaseButton::ButtonSpark( void )
SetThink( &CBaseButton::ButtonSpark ); SetThink( &CBaseButton::ButtonSpark );
pev->nextthink = pev->ltime + 0.1f + RANDOM_FLOAT( 0.0f, 1.5f );// spark again at random interval pev->nextthink = pev->ltime + 0.1f + RANDOM_FLOAT( 0.0f, 1.5f );// spark again at random interval
DoSpark( pev, pev->mins ); DoSpark( pev, pev->absmin );
} }
// //

9
dlls/client.cpp

@ -734,7 +734,7 @@ void ServerActivate( edict_t *pEdictList, int edictCount, int clientMax )
continue; continue;
// Clients aren't necessarily initialized until ClientPutInServer() // Clients aren't necessarily initialized until ClientPutInServer()
if( i < clientMax || !pEdictList[i].pvPrivateData ) if( (i > 0 && i <= clientMax) || !pEdictList[i].pvPrivateData )
continue; continue;
pClass = CBaseEntity::Instance( &pEdictList[i] ); pClass = CBaseEntity::Instance( &pEdictList[i] );
@ -1627,6 +1627,7 @@ void RegisterEncoders( void )
int GetWeaponData( struct edict_s *player, struct weapon_data_s *info ) int GetWeaponData( struct edict_s *player, struct weapon_data_s *info )
{ {
memset( info, 0, MAX_WEAPONS * sizeof(weapon_data_t) );
#if CLIENT_WEAPONS #if CLIENT_WEAPONS
int i; int i;
weapon_data_t *item; weapon_data_t *item;
@ -1634,8 +1635,6 @@ int GetWeaponData( struct edict_s *player, struct weapon_data_s *info )
CBasePlayer *pl = (CBasePlayer *)CBasePlayer::Instance( pev ); CBasePlayer *pl = (CBasePlayer *)CBasePlayer::Instance( pev );
CBasePlayerWeapon *gun; CBasePlayerWeapon *gun;
memset( info, 0, 32 * sizeof(weapon_data_t) );
if( !pl ) if( !pl )
return 1; return 1;
@ -1656,7 +1655,7 @@ int GetWeaponData( struct edict_s *player, struct weapon_data_s *info )
// Get The ID. // Get The ID.
gun->GetItemInfo( &II ); gun->GetItemInfo( &II );
if( II.iId >= 0 && II.iId < 32 ) if( II.iId >= 0 && II.iId < MAX_WEAPONS )
{ {
item = &info[II.iId]; item = &info[II.iId];
@ -1682,8 +1681,6 @@ int GetWeaponData( struct edict_s *player, struct weapon_data_s *info )
} }
} }
} }
#else
memset( info, 0, 32 * sizeof(weapon_data_t) );
#endif #endif
return 1; return 1;
} }

25
dlls/player.cpp

@ -3095,7 +3095,15 @@ void CBasePlayer::SelectItem( const char *pstr )
if( m_pActiveItem ) if( m_pActiveItem )
{ {
CBasePlayerWeapon* weapon = (CBasePlayerWeapon*)(m_pActiveItem->GetWeaponPtr());
if (weapon)
weapon->m_ForceSendAnimations = true;
m_pActiveItem->Deploy(); m_pActiveItem->Deploy();
if (weapon)
weapon->m_ForceSendAnimations = false;
m_pActiveItem->UpdateItemInfo(); m_pActiveItem->UpdateItemInfo();
} }
} }
@ -3121,7 +3129,16 @@ void CBasePlayer::SelectLastItem( void )
CBasePlayerItem *pTemp = m_pActiveItem; CBasePlayerItem *pTemp = m_pActiveItem;
m_pActiveItem = m_pLastItem; m_pActiveItem = m_pLastItem;
m_pLastItem = pTemp; m_pLastItem = pTemp;
CBasePlayerWeapon* weapon = (CBasePlayerWeapon*)(m_pActiveItem->GetWeaponPtr());
if (weapon)
weapon->m_ForceSendAnimations = true;
m_pActiveItem->Deploy(); m_pActiveItem->Deploy();
if (weapon)
weapon->m_ForceSendAnimations = false;
m_pActiveItem->UpdateItemInfo(); m_pActiveItem->UpdateItemInfo();
} }
@ -4614,8 +4631,16 @@ BOOL CBasePlayer::SwitchWeapon( CBasePlayerItem *pWeapon )
} }
m_pActiveItem = pWeapon; m_pActiveItem = pWeapon;
CBasePlayerWeapon* weapon = (CBasePlayerWeapon*)(pWeapon->GetWeaponPtr());
if (weapon)
weapon->m_ForceSendAnimations = true;
pWeapon->Deploy(); pWeapon->Deploy();
if (weapon)
weapon->m_ForceSendAnimations = false;
return TRUE; return TRUE;
} }

15
dlls/scientist.cpp

@ -612,6 +612,13 @@ void CScientist::HandleAnimEvent( MonsterEvent_t *pEvent )
//========================================================= //=========================================================
void CScientist::Spawn( void ) void CScientist::Spawn( void )
{ {
// We need to set it before precache so the right voice will be chosen
if( pev->body == -1 )
{
// -1 chooses a random head
pev->body = RANDOM_LONG( 0, NUM_SCIENTIST_HEADS - 1 );// pick a head, any head
}
Precache(); Precache();
SET_MODEL( ENT( pev ), "models/scientist.mdl" ); SET_MODEL( ENT( pev ), "models/scientist.mdl" );
@ -638,12 +645,6 @@ void CScientist::Spawn( void )
// White hands // White hands
pev->skin = 0; pev->skin = 0;
if( pev->body == -1 )
{
// -1 chooses a random head
pev->body = RANDOM_LONG( 0, NUM_SCIENTIST_HEADS - 1 );// pick a head, any head
}
// Luther is black, make his hands black // Luther is black, make his hands black
if( pev->body == HEAD_LUTHER ) if( pev->body == HEAD_LUTHER )
pev->skin = 1; pev->skin = 1;
@ -748,7 +749,7 @@ void CScientist::TalkInit()
} }
// get voice for head // get voice for head
switch( pev->body % 3 ) switch( pev->body % NUM_SCIENTIST_HEADS )
{ {
default: default:
case HEAD_GLASSES: case HEAD_GLASSES:

7
dlls/tripmine.cpp

@ -364,7 +364,12 @@ void CTripmine::Spawn()
m_iId = WEAPON_TRIPMINE; m_iId = WEAPON_TRIPMINE;
SET_MODEL( ENT( pev ), "models/v_tripmine.mdl" ); SET_MODEL( ENT( pev ), "models/v_tripmine.mdl" );
pev->frame = 0; pev->frame = 0;
#ifdef CLIENT_DLL
pev->body = 0;
#else
pev->body = 3; pev->body = 3;
#endif
pev->sequence = TRIPMINE_GROUND; pev->sequence = TRIPMINE_GROUND;
// ResetSequenceInfo(); // ResetSequenceInfo();
pev->framerate = 0; pev->framerate = 0;
@ -449,7 +454,7 @@ void CTripmine::PrimaryAttack( void )
#else #else
flags = 0; flags = 0;
#endif #endif
PLAYBACK_EVENT_FULL( flags, m_pPlayer->edict(), m_usTripFire, 0.0f, g_vecZero, g_vecZero, 0.0f, 0.0f, 0, 0, 0, 0 ); PLAYBACK_EVENT_FULL( flags, m_pPlayer->edict(), m_usTripFire, 0.0f, g_vecZero, g_vecZero, 0.0f, 0.0f, 0, 0, m_pPlayer->m_rgAmmo[m_iPrimaryAmmoType] == 1, 0 );
if( tr.flFraction < 1.0f ) if( tr.flFraction < 1.0f )
{ {

2
dlls/weapons.cpp

@ -831,7 +831,7 @@ int CBasePlayerWeapon::UpdateClientData( CBasePlayer *pPlayer )
void CBasePlayerWeapon::SendWeaponAnim( int iAnim, int skiplocal, int body ) void CBasePlayerWeapon::SendWeaponAnim( int iAnim, int skiplocal, int body )
{ {
if( UseDecrement() ) if( UseDecrement() )
skiplocal = 1; skiplocal = !m_ForceSendAnimations;
else else
skiplocal = 0; skiplocal = 0;

5
dlls/weapons.h

@ -87,8 +87,6 @@ public:
#define WEAPON_SUIT 31 // ????? #define WEAPON_SUIT 31 // ?????
#define MAX_WEAPONS 32
#define MAX_NORMAL_BATTERY 100 #define MAX_NORMAL_BATTERY 100
// weapon weight factors (for auto-switching) (-1 = noswitch) // weapon weight factors (for auto-switching) (-1 = noswitch)
@ -361,6 +359,9 @@ public:
// hle time creep vars // hle time creep vars
float m_flPrevPrimaryAttack; float m_flPrevPrimaryAttack;
float m_flLastFireTime; float m_flLastFireTime;
//Hack so deploy animations work when weapon prediction is enabled.
bool m_ForceSendAnimations;
}; };
class CBasePlayerAmmo : public CBaseEntity class CBasePlayerAmmo : public CBaseEntity

16
pm_shared/pm_shared.c

@ -120,6 +120,20 @@ static char grgchTextureType[CTEXTURESMAX];
int g_onladder = 0; int g_onladder = 0;
static void PM_InitTrace( trace_t *trace, const vec3_t end )
{
memset( trace, 0, sizeof( *trace ));
VectorCopy( end, trace->endpos );
trace->allsolid = true;
trace->fraction = 1.0f;
}
static void PM_TraceModel( physent_t *pe, float *start, float *end, trace_t *trace )
{
PM_InitTrace( trace, end );
pmove->PM_TraceModel(pe, start, end, trace);
}
void PM_SwapTextures( int i, int j ) void PM_SwapTextures( int i, int j )
{ {
char chTemp; char chTemp;
@ -2108,7 +2122,7 @@ void PM_LadderMove( physent_t *pLadder )
onFloor = false; onFloor = false;
pmove->gravity = 0; pmove->gravity = 0;
pmove->PM_TraceModel( pLadder, pmove->origin, ladderCenter, &trace ); PM_TraceModel(pLadder, pmove->origin, ladderCenter, &trace);
if( trace.fraction != 1.0f ) if( trace.fraction != 1.0f )
{ {
float forward = 0, right = 0; float forward = 0, right = 0;

4
scripts/waifulib/xcompile.py

@ -20,12 +20,12 @@ import os
import sys import sys
ANDROID_NDK_ENVVARS = ['ANDROID_NDK_HOME', 'ANDROID_NDK'] ANDROID_NDK_ENVVARS = ['ANDROID_NDK_HOME', 'ANDROID_NDK']
ANDROID_NDK_SUPPORTED = [10, 19, 20, 23] ANDROID_NDK_SUPPORTED = [10, 19, 20, 23, 25]
ANDROID_NDK_HARDFP_MAX = 11 # latest version that supports hardfp ANDROID_NDK_HARDFP_MAX = 11 # latest version that supports hardfp
ANDROID_NDK_GCC_MAX = 17 # latest NDK that ships with GCC ANDROID_NDK_GCC_MAX = 17 # latest NDK that ships with GCC
ANDROID_NDK_UNIFIED_SYSROOT_MIN = 15 ANDROID_NDK_UNIFIED_SYSROOT_MIN = 15
ANDROID_NDK_SYSROOT_FLAG_MAX = 19 # latest NDK that need --sysroot flag ANDROID_NDK_SYSROOT_FLAG_MAX = 19 # latest NDK that need --sysroot flag
ANDROID_NDK_API_MIN = { 10: 3, 19: 16, 20: 16, 23: 16 } # minimal API level ndk revision supports ANDROID_NDK_API_MIN = { 10: 3, 19: 16, 20: 16, 23: 16, 25: 19 } # minimal API level ndk revision supports
ANDROID_STPCPY_API_MIN = 21 # stpcpy() introduced in SDK 21 ANDROID_STPCPY_API_MIN = 21 # stpcpy() introduced in SDK 21
ANDROID_64BIT_API_MIN = 21 # minimal API level that supports 64-bit targets ANDROID_64BIT_API_MIN = 21 # minimal API level that supports 64-bit targets

Loading…
Cancel
Save