diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index c8e6284a47..6da0186250 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -20,6 +20,7 @@ jobs: env: CC: ${{ matrix.cc }} CXX: ${{ matrix.cxx }} + STEAMRT_SNAPSHOT: latest-steam-client-general-availability steps: - name: Checkout uses: actions/checkout@v4 @@ -38,10 +39,10 @@ jobs: uses: actions/cache@v4 with: path: com.valvesoftware.SteamRuntime.Sdk-i386-scout-sysroot.tar.gz - key: ${{ runner.os }}-steam-runtime + key: steam-runtime-${{ env.STEAMRT_SNAPSHOT }} - 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 + run: wget --no-verbose https://repo.steampowered.com/steamrt-images-scout/snapshots/${{ env.STEAMRT_SNAPSHOT }}/com.valvesoftware.SteamRuntime.Sdk-i386-scout-sysroot.tar.gz - name: Install steam runtime if: startsWith(matrix.os, 'ubuntu') run: | @@ -52,14 +53,15 @@ jobs: - name: Build on Linux if: startsWith(matrix.os, 'ubuntu') run: | - schroot --chroot steamrt_scout_i386 -- cmake -DCMAKE_BUILD_TYPE=Release -DPOLLY=ON -B build -S . -DCMAKE_EXE_LINKER_FLAGS="-Wl,--no-undefined" -DCMAKE_INSTALL_PREFIX="$PWD/dist" + schroot --chroot steamrt_scout_i386 -- cmake -GNinja -DCMAKE_BUILD_TYPE=Release -DPOLLY=ON -B build -S . -DCMAKE_EXE_LINKER_FLAGS="-Wl,--no-undefined" -DCMAKE_INSTALL_PREFIX="$PWD/dist" schroot --chroot steamrt_scout_i386 -- cmake --build build --target all schroot --chroot steamrt_scout_i386 -- cmake --build build --target install - name: Build on Linux with vgui if: startsWith(matrix.os, 'ubuntu') && startsWith(matrix.cc, 'gcc') run: | - schroot --chroot steamrt_scout_i386 -- cmake -DCMAKE_BUILD_TYPE=Release -DPOLLY=ON -B build-vgui -S . -DCMAKE_EXE_LINKER_FLAGS="-Wl,--no-undefined" -DUSE_VGUI=ON -DCMAKE_INSTALL_PREFIX="$PWD/dist-vgui" + schroot --chroot steamrt_scout_i386 -- cmake -GNinja -DCMAKE_BUILD_TYPE=Release -DPOLLY=ON -B build-vgui -S . -DCMAKE_EXE_LINKER_FLAGS="-Wl,--no-undefined" -DUSE_VGUI=ON -DCMAKE_INSTALL_PREFIX="$PWD/dist-vgui" cp vgui_support/vgui-dev/lib/vgui.so build-vgui/cl_dll + cp vgui_support/vgui-dev/lib/vgui.so build-vgui schroot --chroot steamrt_scout_i386 -- cmake --build build-vgui --target all schroot --chroot steamrt_scout_i386 -- cmake --build build-vgui --target install diff --git a/.github/workflows/manual.yml b/.github/workflows/manual.yml index f34153b11c..ee000cf565 100644 --- a/.github/workflows/manual.yml +++ b/.github/workflows/manual.yml @@ -15,6 +15,10 @@ on: options: - 'OFF' - 'ON' + steamrt_snapshot: + type: string + description: SteamRT Snapshot + default: 'latest-steam-client-general-availability' jobs: build: runs-on: ${{ matrix.os }} @@ -48,10 +52,10 @@ jobs: uses: actions/cache@v4 with: path: com.valvesoftware.SteamRuntime.Sdk-i386-scout-sysroot.tar.gz - key: ${{ runner.os }}-steam-runtime + key: steam-runtime-${{ github.event.inputs.steamrt_snapshot }} - 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 + run: wget --no-verbose https://repo.steampowered.com/steamrt-images-scout/snapshots/${{ github.event.inputs.steamrt_snapshot }}/com.valvesoftware.SteamRuntime.Sdk-i386-scout-sysroot.tar.gz - name: Install steam runtime if: startsWith(matrix.os, 'ubuntu') run: | @@ -64,10 +68,11 @@ jobs: run: | mkdir -p build/cl_dll cp vgui_support/vgui-dev/lib/vgui.so build/cl_dll + cp vgui_support/vgui-dev/lib/vgui.so build - 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 -GNinja -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 @@ -93,11 +98,6 @@ jobs: 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@v4 diff --git a/cl_dll/CMakeLists.txt b/cl_dll/CMakeLists.txt index 46d22efc16..cbcae6ce87 100644 --- a/cl_dll/CMakeLists.txt +++ b/cl_dll/CMakeLists.txt @@ -228,11 +228,14 @@ if(HAVE_LTO) endif() install( TARGETS ${CLDLL_LIBRARY} - DESTINATION "${GAMEDIR}/${CLIENT_INSTALL_DIR}/" + RUNTIME DESTINATION "${GAMEDIR}/${CLIENT_INSTALL_DIR}/" + LIBRARY DESTINATION "${GAMEDIR}/${CLIENT_INSTALL_DIR}/" PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE GROUP_READ GROUP_EXECUTE WORLD_READ WORLD_EXECUTE ) -add_custom_command(TARGET ${CLDLL_LIBRARY} +if(CMAKE_BUILD_TYPE MATCHES "Release") + add_custom_command(TARGET ${CLDLL_LIBRARY} POST_BUILD DEPENDS ${CLDLL_LIBRARY} - COMMAND $<$:${CMAKE_STRIP}> -s $) + COMMAND ${CMAKE_STRIP} -s $) +endif() diff --git a/cl_dll/ammo.cpp b/cl_dll/ammo.cpp index 81302a35a6..f4c2e1cddb 100644 --- a/cl_dll/ammo.cpp +++ b/cl_dll/ammo.cpp @@ -647,7 +647,9 @@ int CHudAmmo::MsgFunc_WeaponList( const char *pszName, int iSize, void *pbuf ) WEAPON Weapon; - strcpy( Weapon.szName, READ_STRING() ); + strncpy( Weapon.szName, READ_STRING(), sizeof(Weapon.szName) ); + Weapon.szName[sizeof(Weapon.szName) - 1] = '\0'; + Weapon.iAmmoType = (int)READ_CHAR(); Weapon.iMax1 = READ_BYTE(); @@ -665,6 +667,21 @@ int CHudAmmo::MsgFunc_WeaponList( const char *pszName, int iSize, void *pbuf ) Weapon.iFlags = READ_BYTE(); Weapon.iClip = 0; + if( Weapon.iId < 0 || Weapon.iId >= MAX_WEAPONS ) + return 0; + if( Weapon.iSlot < 0 || Weapon.iSlot >= MAX_WEAPON_SLOTS + 1 ) + return 0; + if( Weapon.iSlotPos < 0 || Weapon.iSlotPos >= MAX_WEAPON_POSITIONS + 1 ) + return 0; + if( Weapon.iAmmoType < -1 || Weapon.iAmmoType >= MAX_AMMO_TYPES ) + return 0; + if( Weapon.iAmmo2Type < -1 || Weapon.iAmmo2Type >= MAX_AMMO_TYPES ) + return 0; + if( Weapon.iAmmoType >= 0 && Weapon.iMax1 == 0 ) + return 0; + if( Weapon.iAmmo2Type >= 0 && Weapon.iMax2 == 0 ) + return 0; + gWR.AddWeapon( &Weapon ); return 1; @@ -1175,7 +1192,7 @@ client_sprite_t *GetSpriteList( client_sprite_t *pList, const char *psz, int iRe while( i-- ) { - if( ( !strcmp( psz, p->szName ) ) && ( p->iRes == iRes ) ) + if( p->iRes == iRes && !strcmp( psz, p->szName )) return p; p++; } diff --git a/cl_dll/cl_util.h b/cl_dll/cl_util.h index e13c344f80..8a2d86edc7 100644 --- a/cl_dll/cl_util.h +++ b/cl_dll/cl_util.h @@ -71,6 +71,8 @@ inline struct cvar_s *CVAR_CREATE( const char *cv, const char *val, const int fl // Use this to set any co-ords in 640x480 space #define XRES(x) ( (int)( float(x) * ( (float)ScreenWidth / 640.0f ) + 0.5f ) ) #define YRES(y) ( (int)( float(y) * ( (float)ScreenHeight / 480.0f ) + 0.5f ) ) +#define XRES_HD(x) ( (int)( float(x) * Q_max(1.f, (float)ScreenWidth / 1280.f ))) +#define YRES_HD(y) ( (int)( float(y) * Q_max(1.f, (float)ScreenHeight / 720.f ))) // use this to project world coordinates to screen coordinates #define XPROJECT(x) ( ( 1.0f + (x) ) * ScreenWidth * 0.5f ) diff --git a/cl_dll/death.cpp b/cl_dll/death.cpp index 606b64050c..0ecfaa8073 100644 --- a/cl_dll/death.cpp +++ b/cl_dll/death.cpp @@ -96,6 +96,17 @@ int CHudDeathNotice::Draw( float flTime ) { int x, y, r, g, b; + int gap = 20; + + const wrect_t& sprite = gHUD.GetSpriteRect(m_HUD_d_skull); + gap = sprite.bottom - sprite.top; + + SCREENINFO screenInfo; + + screenInfo.iSize = sizeof(SCREENINFO); + gEngfuncs.pfnGetScreenInfo(&screenInfo); + gap = Q_max( gap, screenInfo.iCharHeight ); + for( int i = 0; i < MAX_DEATHNOTICES; i++ ) { if( rgDeathNoticeList[i].iId == 0 ) @@ -119,10 +130,10 @@ int CHudDeathNotice::Draw( float flTime ) #endif { // Draw the death notice - y = YRES( DEATHNOTICE_TOP ) + 2 + ( 20 * i ); //!!! + y = YRES( DEATHNOTICE_TOP ) + 2 + ( gap * i ); //!!! int id = ( rgDeathNoticeList[i].iId == -1 ) ? m_HUD_d_skull : rgDeathNoticeList[i].iId; - x = ScreenWidth - ConsoleStringLen( rgDeathNoticeList[i].szVictim ) - ( gHUD.GetSpriteRect(id).right - gHUD.GetSpriteRect(id).left ); + x = ScreenWidth - ConsoleStringLen( rgDeathNoticeList[i].szVictim ) - ( gHUD.GetSpriteRect(id).right - gHUD.GetSpriteRect(id).left ) - 4; if( !rgDeathNoticeList[i].iSuicide ) { @@ -131,7 +142,7 @@ int CHudDeathNotice::Draw( float flTime ) // Draw killers name if( rgDeathNoticeList[i].KillerColor ) DrawSetTextColor( rgDeathNoticeList[i].KillerColor[0], rgDeathNoticeList[i].KillerColor[1], rgDeathNoticeList[i].KillerColor[2] ); - x = 5 + DrawConsoleString( x, y, rgDeathNoticeList[i].szKiller ); + x = 5 + DrawConsoleString( x, y + 4, rgDeathNoticeList[i].szKiller ); } r = 255; g = 80; b = 0; @@ -151,7 +162,7 @@ int CHudDeathNotice::Draw( float flTime ) { if( rgDeathNoticeList[i].VictimColor ) DrawSetTextColor( rgDeathNoticeList[i].VictimColor[0], rgDeathNoticeList[i].VictimColor[1], rgDeathNoticeList[i].VictimColor[2] ); - x = DrawConsoleString( x, y, rgDeathNoticeList[i].szVictim ); + x = DrawConsoleString( x, y + 4, rgDeathNoticeList[i].szVictim ); } } } diff --git a/cl_dll/hud_spectator.cpp b/cl_dll/hud_spectator.cpp index 278ab8be1f..21d0235f16 100644 --- a/cl_dll/hud_spectator.cpp +++ b/cl_dll/hud_spectator.cpp @@ -218,7 +218,9 @@ void UTIL_StringToVector( float * pVector, const char *pString ) char *pstr, *pfront, tempString[128]; int j; - strcpy( tempString, pString ); + strncpy( tempString, pString, sizeof( tempString ) ); + tempString[sizeof( tempString ) - 1] = '\0'; + pstr = pfront = tempString; for( j = 0; j < 3; j++ ) @@ -655,10 +657,10 @@ int CHudSpectator::Draw( float flTime ) // check if name would be in inset window if( m_pip->value != INSET_OFF ) { - if( m_vPlayerPos[i][0] > XRES( m_OverviewData.insetWindowX ) && - m_vPlayerPos[i][1] > YRES( m_OverviewData.insetWindowY ) && - m_vPlayerPos[i][0] < XRES( m_OverviewData.insetWindowX + m_OverviewData.insetWindowWidth ) && - m_vPlayerPos[i][1] < YRES( m_OverviewData.insetWindowY + m_OverviewData.insetWindowHeight) ) + if( m_vPlayerPos[i][0] > XRES_HD( m_OverviewData.insetWindowX ) && + m_vPlayerPos[i][1] > YRES_HD( m_OverviewData.insetWindowY ) && + m_vPlayerPos[i][0] < XRES_HD( m_OverviewData.insetWindowX + m_OverviewData.insetWindowWidth ) && + m_vPlayerPos[i][1] < YRES_HD( m_OverviewData.insetWindowY + m_OverviewData.insetWindowHeight) ) continue; } @@ -725,9 +727,9 @@ void CHudSpectator::DirectorMessage( int iSize, void *pbuf ) v1[1] = READ_COORD(); v1[2] = READ_COORD(); // vJumpOrigin - v1[0] = READ_COORD(); // view angle - v1[1] = READ_COORD(); // vJumpAngles - v1[2] = READ_COORD(); + v2[0] = READ_COORD(); // view angle + v2[1] = READ_COORD(); // vJumpAngles + v2[2] = READ_COORD(); f1 = READ_BYTE(); // fov i1 = READ_WORD(); // target diff --git a/cl_dll/input_goldsource.cpp b/cl_dll/input_goldsource.cpp index 80a0ab5e34..26567c0a6c 100644 --- a/cl_dll/input_goldsource.cpp +++ b/cl_dll/input_goldsource.cpp @@ -1592,7 +1592,7 @@ void GoldSourceInput::IN_Init (void) { ignoreNextDelta = false; m_filter = gEngfuncs.pfnRegisterVariable ( "m_filter","0", FCVAR_ARCHIVE ); - sensitivity = gEngfuncs.pfnRegisterVariable ( "sensitivity","3", FCVAR_ARCHIVE ); // user mouse sensitivity setting. + sensitivity = gEngfuncs.pfnRegisterVariable ( "sensitivity","3", FCVAR_ARCHIVE | FCVAR_FILTERSTUFFTEXT ); // user mouse sensitivity setting. in_joystick = gEngfuncs.pfnRegisterVariable ( "joystick","0", FCVAR_ARCHIVE ); joy_name = gEngfuncs.pfnRegisterVariable ( "joyname", "joystick", 0 ); @@ -1614,6 +1614,11 @@ void GoldSourceInput::IN_Init (void) joy_wwhack1 = gEngfuncs.pfnRegisterVariable ( "joywwhack1", "0.0", 0 ); joy_wwhack2 = gEngfuncs.pfnRegisterVariable ( "joywwhack2", "0.0", 0 ); + // HL25 checks this cvar and if it doesn't exist or set to zero + // it will lock any usage of gamepads + // see: https://github.com/ValveSoftware/halflife/issues/3621 + gEngfuncs.pfnRegisterVariable( "joysupported", "1", 0 ); + m_customaccel = gEngfuncs.pfnRegisterVariable ( "m_customaccel", "0", FCVAR_ARCHIVE ); m_customaccel_scale = gEngfuncs.pfnRegisterVariable ( "m_customaccel_scale", "0.04", FCVAR_ARCHIVE ); m_customaccel_max = gEngfuncs.pfnRegisterVariable ( "m_customaccel_max", "0", FCVAR_ARCHIVE ); diff --git a/cl_dll/input_xash3d.cpp b/cl_dll/input_xash3d.cpp index ba5b14fd99..4f2ea39f14 100644 --- a/cl_dll/input_xash3d.cpp +++ b/cl_dll/input_xash3d.cpp @@ -280,7 +280,7 @@ void FWGSInput::IN_Shutdown( void ) // Register cvars and reset data void FWGSInput::IN_Init( void ) { - sensitivity = gEngfuncs.pfnRegisterVariable( "sensitivity", "3", FCVAR_ARCHIVE ); + sensitivity = gEngfuncs.pfnRegisterVariable( "sensitivity", "3", FCVAR_ARCHIVE | FCVAR_FILTERSTUFFTEXT ); in_joystick = gEngfuncs.pfnRegisterVariable( "joystick", "0", FCVAR_ARCHIVE ); cl_laddermode = gEngfuncs.pfnRegisterVariable( "cl_laddermode", "2", FCVAR_ARCHIVE ); ac_forwardmove = ac_sidemove = rel_yaw = rel_pitch = 0; diff --git a/cl_dll/menu.cpp b/cl_dll/menu.cpp index 45147e78e4..5f732d9a98 100644 --- a/cl_dll/menu.cpp +++ b/cl_dll/menu.cpp @@ -51,6 +51,7 @@ void CHudMenu::InitHUDData( void ) { m_fMenuDisplayed = 0; m_bitsValidSlots = 0; + m_iFlags &= ~HUD_ACTIVE; Reset(); } @@ -87,6 +88,11 @@ int CHudMenu::Draw( float flTime ) return 1; #endif + SCREENINFO screenInfo; + + screenInfo.iSize = sizeof( SCREENINFO ); + gEngfuncs.pfnGetScreenInfo( &screenInfo ); + // draw the menu, along the left-hand side of the screen // count the number of newlines int nlc = 0; @@ -96,15 +102,17 @@ int CHudMenu::Draw( float flTime ) nlc++; } + int nFontHeight = Q_max(12, screenInfo.iCharHeight); + // center it - int y = ( ScreenHeight / 2 ) - ( ( nlc / 2 ) * 12 ) - 40; // make sure it is above the say text + int y = ( ScreenHeight / 2 ) - ( ( nlc / 2 ) * nFontHeight ) - (3 * nFontHeight + nFontHeight / 3); // make sure it is above the say text int x = 20; i = 0; while( i < MAX_MENU_STRING && g_szMenuString[i] != '\0' ) { gHUD.DrawHudString( x, y, 320, g_szMenuString + i, 255, 255, 255 ); - y += 12; + y += nFontHeight; while( i < MAX_MENU_STRING && g_szMenuString[i] != '\0' && g_szMenuString[i] != '\n' ) i++; diff --git a/cl_dll/vgui_SpectatorPanel.cpp b/cl_dll/vgui_SpectatorPanel.cpp index 2d78b93280..df04a0cc57 100644 --- a/cl_dll/vgui_SpectatorPanel.cpp +++ b/cl_dll/vgui_SpectatorPanel.cpp @@ -37,11 +37,11 @@ extern "C" void DLLEXPORT HUD_ChatInputPosition( int *x, int *y ) { if ( gHUD.m_Spectator.m_pip->value == INSET_OFF ) { - *y = YRES( PANEL_HEIGHT ); + *y = YRES_HD( PANEL_HEIGHT ); } else { - *y = YRES( gHUD.m_Spectator.m_OverviewData.insetWindowHeight + 5 ); + *y = YRES_HD( gHUD.m_Spectator.m_OverviewData.insetWindowHeight + 5 ); } } } @@ -101,15 +101,15 @@ void SpectatorPanel::Initialize() SchemeHandle_t hSmallScheme = pSchemes->getSchemeHandle( "Team Info Text" ); - m_TopBorder = new CTransparentPanel( 64, 0, 0, ScreenWidth, YRES( PANEL_HEIGHT ) ); + m_TopBorder = new CTransparentPanel( 64, 0, 0, ScreenWidth, YRES_HD( PANEL_HEIGHT ) ); m_TopBorder->setParent( this ); - m_BottomBorder = new CTransparentPanel( 64, 0, ScreenHeight - YRES( 32 ), ScreenWidth, YRES( PANEL_HEIGHT ) ); + m_BottomBorder = new CTransparentPanel( 64, 0, ScreenHeight - YRES_HD( PANEL_HEIGHT ), ScreenWidth, YRES_HD( PANEL_HEIGHT ) ); m_BottomBorder->setParent( this ); setPaintBackgroundEnabled( false ); - m_ExtraInfo = new Label( "Extra Info", 0, 0, wide, YRES( PANEL_HEIGHT ) ); + m_ExtraInfo = new Label( "Extra Info", 0, 0, wide, YRES_HD( PANEL_HEIGHT ) ); m_ExtraInfo->setParent( m_TopBorder ); m_ExtraInfo->setFont( pSchemes->getFont( hSmallScheme ) ); @@ -120,24 +120,24 @@ void SpectatorPanel::Initialize() m_TimerImage = new CImageLabel( "timer", 0, 0, 14, 14 ); m_TimerImage->setParent( m_TopBorder ); - m_TopBanner = new CImageLabel( "banner", 0, 0, XRES( BANNER_WIDTH ), YRES( BANNER_HEIGHT ) ); + m_TopBanner = new CImageLabel( "banner", 0, 0, XRES_HD( BANNER_WIDTH ), YRES_HD( BANNER_HEIGHT ) ); m_TopBanner->setParent( this ); - m_CurrentTime = new Label( "00:00", 0, 0, wide, YRES( PANEL_HEIGHT ) ); + m_CurrentTime = new Label( "00:00", 0, 0, wide, YRES_HD( PANEL_HEIGHT ) ); m_CurrentTime->setParent( m_TopBorder ); m_CurrentTime->setFont( pSchemes->getFont( hSmallScheme ) ); m_CurrentTime->setPaintBackgroundEnabled( false ); m_CurrentTime->setFgColor( 143, 143, 54, 0 ); m_CurrentTime->setContentAlignment( vgui::Label::a_west ); - m_Separator = new Panel( 0, 0, XRES( 64 ), YRES( 96 ) ); + m_Separator = new Panel( 0, 0, XRES_HD( 64 ), YRES_HD( 96 ) ); m_Separator->setParent( m_TopBorder ); m_Separator->setFgColor( 59, 58, 34, 48 ); m_Separator->setBgColor( 59, 58, 34, 48 ); for( int j = 0; j < TEAM_NUMBER; j++ ) { - m_TeamScores[j] = new Label( " ", 0, 0, wide, YRES( PANEL_HEIGHT ) ); + m_TeamScores[j] = new Label( " ", 0, 0, wide, YRES_HD( PANEL_HEIGHT ) ); m_TeamScores[j]->setParent( m_TopBorder ); m_TeamScores[j]->setFont( pSchemes->getFont( hSmallScheme ) ); m_TeamScores[j]->setPaintBackgroundEnabled( false ); @@ -147,8 +147,8 @@ void SpectatorPanel::Initialize() } // Initialize command buttons. -// m_OptionButton = new ColorButton( CHudTextMessage::BufferedLocaliseTextString( "#SPECT_OPTIONS" ), XRES(15), YRES(6), XRES(OPTIONS_BUTTON_X), YRES(20), false, false ); - m_OptionButton = new DropDownButton( CHudTextMessage::BufferedLocaliseTextString( "#SPECT_OPTIONS" ), XRES(15), YRES(6), XRES(OPTIONS_BUTTON_X), YRES(20), false, false ); +// m_OptionButton = new ColorButton( CHudTextMessage::BufferedLocaliseTextString( "#SPECT_OPTIONS" ), XRES_HD(15), YRES_HD(6), XRES_HD(OPTIONS_BUTTON_X), YRES_HD(20), false, false ); + m_OptionButton = new DropDownButton( CHudTextMessage::BufferedLocaliseTextString( "#SPECT_OPTIONS" ), XRES_HD(15), YRES_HD(6), XRES_HD(OPTIONS_BUTTON_X), YRES_HD(20), false, false ); m_OptionButton->setParent( m_BottomBorder ); m_OptionButton->setContentAlignment( vgui::Label::a_center ); m_OptionButton->setBoundKey( (char)255 ); // special no bound to avoid leading spaces in name @@ -158,7 +158,7 @@ void SpectatorPanel::Initialize() m_OptionButton->setUnArmedColor( 143, 143, 54, 0 ); m_OptionButton->setArmedColor( 194, 202, 54, 0 ); - m_CamButton = new DropDownButton( CHudTextMessage::BufferedLocaliseTextString( "#CAM_OPTIONS" ), ScreenWidth - ( XRES ( CAMOPTIONS_BUTTON_X ) + 15 ), YRES(6), XRES ( CAMOPTIONS_BUTTON_X ), YRES(20), false, false ); + m_CamButton = new DropDownButton( CHudTextMessage::BufferedLocaliseTextString( "#CAM_OPTIONS" ), ScreenWidth - ( XRES_HD( CAMOPTIONS_BUTTON_X ) + 15 ), YRES_HD(6), XRES_HD ( CAMOPTIONS_BUTTON_X ), YRES_HD(20), false, false ); m_CamButton->setParent( m_BottomBorder ); m_CamButton->setContentAlignment( vgui::Label::a_center ); m_CamButton->setBoundKey( (char)255 ); // special no bound to avoid leading spaces in name @@ -168,8 +168,8 @@ void SpectatorPanel::Initialize() m_CamButton->setUnArmedColor( 143, 143, 54, 0 ); m_CamButton->setArmedColor( 194, 202, 54, 0 ); -// m_PrevPlayerButton= new ColorButton("<", XRES( 15 + OPTIONS_BUTTON_X + 15 ), YRES(6), XRES(24), YRES(20), false, false ); - m_PrevPlayerButton= new CImageButton("arrowleft", XRES( 15 + OPTIONS_BUTTON_X + 15 ), YRES(6), XRES(24), YRES(20), false, false ); +// m_PrevPlayerButton= new ColorButton("<", XRES_HD( 15 + OPTIONS_BUTTON_X + 15 ), YRES_HD(6), XRES_HD(24), YRES_HD(20), false, false ); + m_PrevPlayerButton= new CImageButton("arrowleft", XRES_HD( 15 + OPTIONS_BUTTON_X + 15 ), YRES_HD(6), XRES_HD(24), YRES_HD(20), false, false ); m_PrevPlayerButton->setParent( m_BottomBorder ); m_PrevPlayerButton->setContentAlignment( vgui::Label::a_center ); m_PrevPlayerButton->setBoundKey( (char)255 ); // special no bound to avoid leading spaces in name @@ -179,8 +179,8 @@ void SpectatorPanel::Initialize() m_PrevPlayerButton->setUnArmedColor( 143, 143, 54, 0 ); m_PrevPlayerButton->setArmedColor( 194, 202, 54, 0 ); -// m_NextPlayerButton= new ColorButton(">", (ScreenWidth - (XRES ( CAMOPTIONS_BUTTON_X ) + 15)) - XRES ( 24 + 15 ), YRES(6), XRES(24), YRES(20),false, false ); - m_NextPlayerButton= new CImageButton("arrowright", (ScreenWidth - (XRES ( CAMOPTIONS_BUTTON_X ) + 15)) - XRES ( 24 + 15 ), YRES(6), XRES(24), YRES(20),false, false ); +// m_NextPlayerButton= new ColorButton(">", (ScreenWidth - (XRES_HD ( CAMOPTIONS_BUTTON_X ) + 15)) - XRES_HD ( 24 + 15 ), YRES_HD(6), XRES_HD(24), YRES_HD(20),false, false ); + m_NextPlayerButton= new CImageButton("arrowright", (ScreenWidth - (XRES_HD ( CAMOPTIONS_BUTTON_X ) + 15)) - XRES_HD ( 24 + 15 ), YRES_HD(6), XRES_HD(24), YRES_HD(20),false, false ); m_NextPlayerButton->setParent( m_BottomBorder ); m_NextPlayerButton->setContentAlignment( vgui::Label::a_center ); m_NextPlayerButton->setBoundKey( (char)255 ); // special no bound to avoid leading spaces in name @@ -191,10 +191,10 @@ void SpectatorPanel::Initialize() m_NextPlayerButton->setArmedColor( 194, 202, 54, 0 ); // Initialize the bottom title. - float flLabelSize = ( ( ScreenWidth - ( XRES ( CAMOPTIONS_BUTTON_X ) + 15 ) ) - XRES( 24 + 15 ) ) - XRES( ( 15 + OPTIONS_BUTTON_X + 15 ) + 38 ); + float flLabelSize = ( ( ScreenWidth - ( XRES_HD ( CAMOPTIONS_BUTTON_X ) + 15 ) ) - XRES_HD( 24 + 15 ) ) - XRES_HD( ( 15 + OPTIONS_BUTTON_X + 15 ) + 38 ); m_BottomMainButton = new DropDownButton("Spectator Bottom", - XRES( ( 15 + OPTIONS_BUTTON_X + 15 ) + 31 ), YRES(6), flLabelSize, YRES(20), + XRES_HD( ( 15 + OPTIONS_BUTTON_X + 15 ) + 31 ), YRES_HD(6), flLabelSize, YRES_HD(20), false, false ); m_BottomMainButton->setParent(m_BottomBorder); @@ -211,7 +211,7 @@ void SpectatorPanel::Initialize() m_BottomMainLabel = new Label("Spectator Bottom", - XRES( ( 15 + OPTIONS_BUTTON_X + 15 ) + 31 ), YRES(6), flLabelSize, YRES(20)); + XRES_HD( ( 15 + OPTIONS_BUTTON_X + 15 ) + 31 ), YRES_HD(6), flLabelSize, YRES_HD(20)); m_BottomMainLabel->setParent( m_BottomBorder ); m_BottomMainLabel->setPaintBackgroundEnabled( false ); @@ -220,7 +220,7 @@ void SpectatorPanel::Initialize() m_BottomMainLabel->setBorder( NULL ); m_BottomMainLabel->setVisible(false); - m_InsetViewButton = new ColorButton( "", XRES( 2 ), YRES( 2 ), XRES( 240 ), YRES( 180 ), false, false ); + m_InsetViewButton = new ColorButton( "", XRES_HD( 2 ), YRES_HD( 2 ), XRES_HD( 240 ), YRES_HD( 180 ), false, false ); m_InsetViewButton->setParent( this ); m_InsetViewButton->setBoundKey( (char)255 ); m_InsetViewButton->addActionSignal( new CSpectatorHandler_Command( this, SPECTATOR_PANEL_CMD_TOGGLE_INSET ) ); @@ -257,11 +257,11 @@ void SpectatorPanel::ShowMenu( bool isVisible ) m_BottomMainButton->setVisible(false); m_BottomMainLabel->getSize( iLabelSizeX, iLabelSizeY ); - m_BottomMainLabel->setPos( ( ScreenWidth / 2 ) - ( iLabelSizeX / 2 ), YRES( 6 ) ); + m_BottomMainLabel->setPos( ( ScreenWidth / 2 ) - ( iLabelSizeX / 2 ), YRES_HD( 6 ) ); } else { - m_BottomMainButton->setPos( XRES( ( 15 + OPTIONS_BUTTON_X + 15 ) + 31 ), YRES(6) ); + m_BottomMainButton->setPos( XRES_HD( ( 15 + OPTIONS_BUTTON_X + 15 ) + 31 ), YRES_HD(6) ); m_BottomMainLabel->setVisible(false); m_BottomMainButton->setVisible(true); } @@ -328,18 +328,18 @@ void SpectatorPanel::EnableInsetView(bool isEnabled) if( isEnabled ) { // short black bar to see full inset - m_TopBorder->setBounds( XRES( offset ), 0, XRES(640 - offset ), YRES( PANEL_HEIGHT ) ); + m_TopBorder->setBounds( XRES_HD( offset ), 0, XRES_HD(640 - offset ), YRES_HD( PANEL_HEIGHT ) ); if( gEngfuncs.IsSpectateOnly() ) { m_TopBanner->setVisible( true ); - m_TopBanner->setPos( XRES( offset ), 0 ); + m_TopBanner->setPos( XRES_HD( offset ), 0 ); } else m_TopBanner->setVisible( false ); - m_InsetViewButton->setBounds( XRES( x -1 ), YRES( y ), - XRES( wide +2), YRES( tall ) ); + m_InsetViewButton->setBounds( XRES_HD( x -1 ), YRES_HD( y ), + XRES_HD( wide +2), YRES_HD( tall ) ); m_InsetViewButton->setVisible( true ); } else @@ -354,7 +354,7 @@ void SpectatorPanel::EnableInsetView(bool isEnabled) else m_TopBanner->setVisible( false ); - m_TopBorder->setBounds( 0, 0, ScreenWidth, YRES( PANEL_HEIGHT ) ); + m_TopBorder->setBounds( 0, 0, ScreenWidth, YRES_HD( PANEL_HEIGHT ) ); m_InsetViewButton->setVisible( false ); } @@ -393,28 +393,28 @@ void SpectatorPanel::Update() m_ExtraInfo->getTextSize( iTextWidth, iTextHeight ); m_CurrentTime->getTextSize( iTimeWidth, iTimeHeight ); - iTimeWidth += XRES ( SEPERATOR_WIDTH*2 + 1 ); // +timer icon + iTimeWidth += XRES_HD ( SEPERATOR_WIDTH*2 + 1 ); // +timer icon iTimeWidth += ( SEPERATOR_WIDTH-(iTimeWidth%SEPERATOR_WIDTH) ); if( iTimeWidth > iTextWidth ) iTextWidth = iTimeWidth; - int xPos = ScreenWidth - ( iTextWidth + XRES ( SEPERATOR_WIDTH + offset ) ); + int xPos = ScreenWidth - ( iTextWidth + XRES_HD ( SEPERATOR_WIDTH + offset ) ); - m_ExtraInfo->setBounds( xPos, YRES( SEPERATOR_HEIGHT ), iTextWidth, iTextHeight ); + m_ExtraInfo->setBounds( xPos, YRES_HD( SEPERATOR_HEIGHT ), iTextWidth, iTextHeight ); - m_TimerImage->setBounds( xPos, YRES( SEPERATOR_HEIGHT ) + iTextHeight , XRES(SEPERATOR_WIDTH*2 + 1), YRES(SEPERATOR_HEIGHT + 1) ); + m_TimerImage->setBounds( xPos, YRES_HD( SEPERATOR_HEIGHT ) + iTextHeight , XRES_HD(SEPERATOR_WIDTH*2 + 1), YRES_HD(SEPERATOR_HEIGHT + 1) ); - m_CurrentTime->setBounds( xPos + XRES ( SEPERATOR_WIDTH*2 + 1 ), YRES( SEPERATOR_HEIGHT ) + iTextHeight , iTimeWidth, iTimeHeight ); + m_CurrentTime->setBounds( xPos + XRES_HD ( SEPERATOR_WIDTH*2 + 1 ), YRES_HD( SEPERATOR_HEIGHT ) + iTextHeight , iTimeWidth, iTimeHeight ); - m_Separator->setPos( ScreenWidth - ( iTextWidth + XRES ( 2*SEPERATOR_WIDTH+SEPERATOR_WIDTH/2+offset ) ) , YRES( 5 ) ); - m_Separator->setSize( XRES( 1 ), PANEL_HEIGHT - 10 ); + m_Separator->setPos( ScreenWidth - ( iTextWidth + XRES_HD ( 2*SEPERATOR_WIDTH+SEPERATOR_WIDTH/2+offset ) ) , YRES_HD( 5 ) ); + m_Separator->setSize( XRES_HD( 1 ), PANEL_HEIGHT - 10 ); for( j = 0; j < TEAM_NUMBER; j++ ) { int iwidth, iheight; m_TeamScores[j]->getTextSize( iwidth, iheight ); - m_TeamScores[j]->setBounds( ScreenWidth - ( iTextWidth + XRES ( 2*SEPERATOR_WIDTH+2*SEPERATOR_WIDTH/2+offset ) + iwidth ), YRES( SEPERATOR_HEIGHT ) + ( iheight * j ), iwidth, iheight ); + m_TeamScores[j]->setBounds( ScreenWidth - ( iTextWidth + XRES_HD ( 2*SEPERATOR_WIDTH+2*SEPERATOR_WIDTH/2+offset ) + iwidth ), YRES_HD( SEPERATOR_HEIGHT ) + ( iheight * j ), iwidth, iheight ); } } diff --git a/cl_dll/view.cpp b/cl_dll/view.cpp index 4138929640..bdaaab340d 100644 --- a/cl_dll/view.cpp +++ b/cl_dll/view.cpp @@ -1496,10 +1496,10 @@ void V_CalcSpectatorRefdef( struct ref_params_s * pparams ) { // second renderer cycle, inset window // set inset parameters - pparams->viewport[0] = XRES( gHUD.m_Spectator.m_OverviewData.insetWindowX ); // change viewport to inset window - pparams->viewport[1] = YRES( gHUD.m_Spectator.m_OverviewData.insetWindowY ); - pparams->viewport[2] = XRES( gHUD.m_Spectator.m_OverviewData.insetWindowWidth ); - pparams->viewport[3] = YRES( gHUD.m_Spectator.m_OverviewData.insetWindowHeight ); + pparams->viewport[0] = XRES_HD( gHUD.m_Spectator.m_OverviewData.insetWindowX ); // change viewport to inset window + pparams->viewport[1] = YRES_HD( gHUD.m_Spectator.m_OverviewData.insetWindowY ); + pparams->viewport[2] = XRES_HD( gHUD.m_Spectator.m_OverviewData.insetWindowWidth ); + pparams->viewport[3] = YRES_HD( gHUD.m_Spectator.m_OverviewData.insetWindowHeight ); pparams->nextView = 0; // on further view // override some settings in certain modes @@ -1611,7 +1611,7 @@ void V_Init( void ) v_centerspeed = gEngfuncs.pfnRegisterVariable( "v_centerspeed","500", 0 ); cl_bobcycle = gEngfuncs.pfnRegisterVariable( "cl_bobcycle","0.8", 0 );// best default for my experimental gun wag (sjb) - cl_bob = gEngfuncs.pfnRegisterVariable( "cl_bob","0.01", 0 );// best default for my experimental gun wag (sjb) + cl_bob = gEngfuncs.pfnRegisterVariable( "cl_bob","0.01", FCVAR_ARCHIVE );// best default for my experimental gun wag (sjb) cl_bobup = gEngfuncs.pfnRegisterVariable( "cl_bobup","0.5", 0 ); cl_waterdist = gEngfuncs.pfnRegisterVariable( "cl_waterdist","4", 0 ); cl_chasedist = gEngfuncs.pfnRegisterVariable( "cl_chasedist","112", 0 ); diff --git a/cl_dll/wscript b/cl_dll/wscript index 386a245255..847004272a 100644 --- a/cl_dll/wscript +++ b/cl_dll/wscript @@ -20,6 +20,7 @@ def options(opt): opt.load('vgui') def configure(conf): + conf.options.VGUI_DEV = os.path.join('vgui_support', 'vgui-dev') # vgui is in submodule conf.env.USE_VGUI = conf.options.USE_VGUI conf.env.USE_NOVGUI_MOTD = conf.options.USE_NOVGUI_MOTD conf.env.USE_NOVGUI_SCOREBOARD = conf.options.USE_NOVGUI_SCOREBOARD @@ -118,7 +119,6 @@ def build(bld): defines = defines, use = libs, install_path = install_path, - subsystem = bld.env.MSVC_SUBSYSTEM, idx = bld.get_taskgen_count() ) diff --git a/cmake/LibraryNaming.cmake b/cmake/LibraryNaming.cmake index d71919fa2c..5f2634363b 100644 --- a/cmake/LibraryNaming.cmake +++ b/cmake/LibraryNaming.cmake @@ -54,6 +54,8 @@ check_group_build_target(XASH_SERENITY XASH_PLATFORM) check_group_build_target(XASH_IRIX XASH_PLATFORM) check_group_build_target(XASH_NSWITCH XASH_PLATFORM) check_group_build_target(XASH_PSVITA XASH_PLATFORM) +check_group_build_target(XASH_WASI XASH_PLATFORM) +check_group_build_target(XASH_SUNOS XASH_PLATFORM) check_group_build_target(XASH_X86 XASH_ARCHITECTURE) check_group_build_target(XASH_AMD64 XASH_ARCHITECTURE) check_group_build_target(XASH_ARM XASH_ARCHITECTURE) @@ -105,6 +107,10 @@ elseif(XASH_PSVITA) set(BUILDOS "psvita") elseif(XASH_IRIX) set(BUILDOS "irix") +elseif(XASH_WASI) + set(BUILDOS "wasi") +elseif(XASH_SUNOS) + set(BUILDOS "sunos") else() message(SEND_ERROR "Place your operating system name here! If this is a mistake, try to fix conditions above and report a bug") endif() diff --git a/common/cvardef.h b/common/cvardef.h index 1d55f7ca89..4ab46a5057 100644 --- a/common/cvardef.h +++ b/common/cvardef.h @@ -26,6 +26,10 @@ #define FCVAR_PRINTABLEONLY (1<<7) // This cvar's string cannot contain unprintable characters ( e.g., used for player name etc ). #define FCVAR_UNLOGGED (1<<8) // If this is a FCVAR_SERVER, don't log changes to the log file / console if we are creating a log #define FCVAR_NOEXTRAWHITEPACE (1<<9) // strip trailing/leading white space from this cvar +#define FCVAR_PRIVILEGED (1<<10) // Not queryable/settable by unprivileged sources +#define FCVAR_FILTERSTUFFTEXT (1<<11) // Not queryable/settable if unprivileged and filterstufftext is enabled +#define FCVAR_FILTERCHARS (1<<12) // This cvar's string will be filtered for 'bad' characters (e.g. ';', '\n') +#define FCVAR_NOBADPATHS (1<<13) // This cvar's string cannot contain file paths that are above the current directory typedef struct cvar_s { diff --git a/dlls/CMakeLists.txt b/dlls/CMakeLists.txt index a03210ae91..0c3b98da31 100644 --- a/dlls/CMakeLists.txt +++ b/dlls/CMakeLists.txt @@ -190,11 +190,14 @@ if(HAVE_LTO) endif() install( TARGETS ${SVDLL_LIBRARY} - DESTINATION "${GAMEDIR}/${SERVER_INSTALL_DIR}/" + RUNTIME DESTINATION "${GAMEDIR}/${SERVER_INSTALL_DIR}/" + LIBRARY DESTINATION "${GAMEDIR}/${SERVER_INSTALL_DIR}/" PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE GROUP_READ GROUP_EXECUTE WORLD_READ WORLD_EXECUTE) -add_custom_command(TARGET ${SVDLL_LIBRARY} +if(CMAKE_BUILD_TYPE MATCHES "Release") + add_custom_command(TARGET ${SVDLL_LIBRARY} POST_BUILD DEPENDS ${SVDLL_LIBRARY} - COMMAND $<$:${CMAKE_STRIP}> -s $) + COMMAND ${CMAKE_STRIP} -s $) +endif() diff --git a/dlls/basemonster.h b/dlls/basemonster.h index dc642a6c96..e1bafc55b1 100644 --- a/dlls/basemonster.h +++ b/dlls/basemonster.h @@ -129,7 +129,7 @@ class CBaseMonster : public CBaseToggle virtual BOOL ShouldFadeOnDeath( void ); // Basic Monster AI functions - virtual float ChangeYaw( int speed ); + virtual float ChangeYaw( int yawSpeed ); float VecToYaw( Vector vecDir ); float FlYawDiff( void ); diff --git a/dlls/client.cpp b/dlls/client.cpp index 7e77f7b5b4..7da7b2167c 100644 --- a/dlls/client.cpp +++ b/dlls/client.cpp @@ -628,6 +628,14 @@ void ClientCommand( edict_t *pEntity ) strncpy( command, pcmd, sizeof(command) - 1); command[sizeof(command) - 1] = '\0'; + // First parse the name and remove any %'s + for( char *pApersand = command; *pApersand; pApersand++ ) + { + // Replace it with a space + if( *pApersand == '%' ) + *pApersand = ' '; + } + // tell the user they entered an unknown command ClientPrint( &pEntity->v, HUD_PRINTCONSOLE, UTIL_VarArgs( "Unknown command: %s\n", command ) ); } diff --git a/dlls/flyingmonster.cpp b/dlls/flyingmonster.cpp index 424f1dec1f..c33f3c8f2e 100644 --- a/dlls/flyingmonster.cpp +++ b/dlls/flyingmonster.cpp @@ -16,6 +16,7 @@ #include "extdll.h" #include "util.h" #include "cbase.h" +#include "game.h" #include "monsters.h" #include "schedule.h" #include "flyingmonster.h" @@ -83,7 +84,7 @@ void CFlyingMonster::Stop( void ) m_vecTravel = g_vecZero; } -float CFlyingMonster::ChangeYaw( int speed ) +float CFlyingMonster::ChangeYaw( int yawSpeed ) { if( pev->movetype == MOVETYPE_FLY ) { @@ -97,9 +98,25 @@ float CFlyingMonster::ChangeYaw( int speed ) else if( diff > 20.0f ) target = -90.0f; } - pev->angles.z = UTIL_Approach( target, pev->angles.z, 220.0f * gpGlobals->frametime ); + + float speed = 220.f; + + if( monsteryawspeedfix.value ) + { + if( m_flLastZYawTime == 0.f ) + m_flLastZYawTime = gpGlobals->time - gpGlobals->frametime; + + float delta = Q_min( gpGlobals->time - m_flLastZYawTime, 0.25f ); + m_flLastZYawTime = gpGlobals->time; + + speed *= delta; + } + else + speed *= gpGlobals->frametime; + + pev->angles.z = UTIL_Approach( target, pev->angles.z, speed ); } - return CBaseMonster::ChangeYaw( speed ); + return CBaseMonster::ChangeYaw( yawSpeed ); } void CFlyingMonster::Killed( entvars_t *pevAttacker, int iGib ) diff --git a/dlls/flyingmonster.h b/dlls/flyingmonster.h index d043fa22ef..0fd999cb48 100644 --- a/dlls/flyingmonster.h +++ b/dlls/flyingmonster.h @@ -25,7 +25,7 @@ class CFlyingMonster : public CBaseMonster Activity GetStoppedActivity( void ); void Killed( entvars_t *pevAttacker, int iGib ); void Stop( void ); - float ChangeYaw( int speed ); + float ChangeYaw( int yawSpeed ); void HandleAnimEvent( MonsterEvent_t *pEvent ); void MoveExecute( CBaseEntity *pTargetEnt, const Vector &vecDir, float flInterval ); void Move( float flInterval = 0.1 ); @@ -45,5 +45,6 @@ class CFlyingMonster : public CBaseMonster float m_stopTime; // Last time we stopped (to avoid switching states too soon) float m_momentum; // Weight for desired vs. momentum velocity const char *m_pFlapSound; + float m_flLastZYawTime; // Last frame time Z was changed when yaw was changed }; #endif //FLYINGMONSTER_H diff --git a/dlls/game.cpp b/dlls/game.cpp index 140728fb64..a81ae5a6d1 100644 --- a/dlls/game.cpp +++ b/dlls/game.cpp @@ -19,7 +19,7 @@ #include "vcs_info.h" static cvar_t build_commit = { "sv_game_build_commit", g_VCSInfo_Commit }; -static cvar_t build_branch = { "sv_game_build_branch", g_VCSInfo_Commit }; +static cvar_t build_branch = { "sv_game_build_branch", g_VCSInfo_Branch }; cvar_t displaysoundlist = {"displaysoundlist","0"}; @@ -57,10 +57,11 @@ cvar_t multibyte_only = { "mp_multibyte_only", "0", FCVAR_SERVER }; cvar_t mp_chattime = { "mp_chattime","10", FCVAR_SERVER }; // Engine Cvars -cvar_t *g_psv_gravity = NULL; -cvar_t *g_psv_aim = NULL; -cvar_t *g_footsteps = NULL; -cvar_t *g_enable_cheats = NULL; +cvar_t *g_psv_gravity; +cvar_t *g_psv_aim; +cvar_t *g_psv_allow_autoaim; +cvar_t *g_footsteps; +cvar_t *g_enable_cheats; cvar_t *g_psv_developer; @@ -468,6 +469,7 @@ void GameDLLInit( void ) { g_psv_gravity = CVAR_GET_POINTER( "sv_gravity" ); g_psv_aim = CVAR_GET_POINTER( "sv_aim" ); + g_psv_allow_autoaim = CVAR_GET_POINTER( "sv_allow_autoaim" ); g_footsteps = CVAR_GET_POINTER( "mp_footsteps" ); g_psv_developer = CVAR_GET_POINTER( "developer" ); diff --git a/dlls/game.h b/dlls/game.h index 8a0f6d3425..bb8449061c 100644 --- a/dlls/game.h +++ b/dlls/game.h @@ -49,6 +49,7 @@ extern cvar_t sv_busters; // Engine Cvars extern cvar_t *g_psv_gravity; extern cvar_t *g_psv_aim; +extern cvar_t *g_psv_allow_autoaim; extern cvar_t *g_footsteps; extern cvar_t *g_enable_cheats; diff --git a/dlls/ichthyosaur.cpp b/dlls/ichthyosaur.cpp index 0f9fbf5ada..7a2b4fddd8 100644 --- a/dlls/ichthyosaur.cpp +++ b/dlls/ichthyosaur.cpp @@ -21,6 +21,7 @@ #include "extdll.h" #include "util.h" #include "cbase.h" +#include "game.h" #include "monsters.h" #include "schedule.h" #include "flyingmonster.h" @@ -76,7 +77,7 @@ class CIchthyosaur : public CFlyingMonster BOOL CheckMeleeAttack1( float flDot, float flDist ); BOOL CheckRangeAttack1( float flDot, float flDist ); - float ChangeYaw( int speed ); + float ChangeYaw( int yawSpeed ); Activity GetStoppedActivity( void ); void Move( float flInterval ); @@ -88,7 +89,7 @@ class CIchthyosaur : public CFlyingMonster float VectorToPitch( const Vector &vec ); float FlPitchDiff( void ); - float ChangePitch( int speed ); + float ChangePitch( int pitchSpeed ); Vector m_SaveVelocity; float m_idealDist; @@ -106,6 +107,9 @@ class CIchthyosaur : public CFlyingMonster float m_flNextAlert; + float m_flLastPitchTime; // Last frame time pitch was changed + float m_flLastZYawTime; // Last frame time Z was changed when yaw was changed + static const char *pIdleSounds[]; static const char *pAlertSounds[]; static const char *pAttackSounds[]; @@ -780,7 +784,7 @@ float CIchthyosaur::FlPitchDiff( void ) return flPitchDiff; } -float CIchthyosaur::ChangePitch( int speed ) +float CIchthyosaur::ChangePitch( int pitchSpeed ) { if( pev->movetype == MOVETYPE_FLY ) { @@ -793,12 +797,28 @@ float CIchthyosaur::ChangePitch( int speed ) else if( diff > 20 ) target = -45; } - pev->angles.x = UTIL_Approach(target, pev->angles.x, 220.0f * 0.1f ); + + float speed = 220.f; + + if( monsteryawspeedfix.value ) + { + if( m_flLastPitchTime == 0.f ) + m_flLastPitchTime = gpGlobals->time - gpGlobals->frametime; + + float delta = Q_min( gpGlobals->time - m_flLastPitchTime, 0.25f ); + m_flLastPitchTime = gpGlobals->time; + + speed *= delta; + } + else + speed *= 0.1f; + + pev->angles.x = UTIL_Approach(target, pev->angles.x, speed ); } return 0; } -float CIchthyosaur::ChangeYaw( int speed ) +float CIchthyosaur::ChangeYaw( int yawSpeed ) { if( pev->movetype == MOVETYPE_FLY ) { @@ -812,9 +832,25 @@ float CIchthyosaur::ChangeYaw( int speed ) else if( diff > 20 ) target = -20; } - pev->angles.z = UTIL_Approach( target, pev->angles.z, 220.0f * 0.1f ); + + float speed = 220.f; + + if( monsteryawspeedfix.value ) + { + if( m_flLastZYawTime == 0.f ) + m_flLastZYawTime = gpGlobals->time - gpGlobals->frametime; + + float delta = Q_min( gpGlobals->time - m_flLastZYawTime, 0.25f ); + m_flLastZYawTime = gpGlobals->time; + + speed *= delta; + } + else + speed *= 0.1f; + + pev->angles.z = UTIL_Approach( target, pev->angles.z, speed ); } - return CFlyingMonster::ChangeYaw( speed ); + return CFlyingMonster::ChangeYaw( yawSpeed ); } Activity CIchthyosaur::GetStoppedActivity( void ) diff --git a/dlls/maprules.cpp b/dlls/maprules.cpp index 519f7d2a78..7a9e993ec0 100644 --- a/dlls/maprules.cpp +++ b/dlls/maprules.cpp @@ -110,6 +110,7 @@ class CRuleBrushEntity : public CRuleEntity { public: void Spawn( void ); + int ObjectCaps() { return CRuleEntity::ObjectCaps() & ~FCAP_ACROSS_TRANSITION; } private: }; @@ -168,7 +169,7 @@ void CGameScore::Use( CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE us return; // Only players can use this - if( pActivator->IsPlayer() ) + if( pActivator && pActivator->IsPlayer() ) { if( AwardToTeam() ) { @@ -764,7 +765,7 @@ void CGamePlayerEquip::KeyValue( KeyValueData *pkvd ) { char tmp[128]; - UTIL_StripToken( pkvd->szKeyName, tmp ); + UTIL_StripToken( pkvd->szKeyName, tmp, sizeof( tmp )); m_weaponNames[i] = ALLOC_STRING( tmp ); m_weaponCount[i] = atoi( pkvd->szValue ); diff --git a/dlls/monsters.cpp b/dlls/monsters.cpp index a24a417a10..e41e795014 100644 --- a/dlls/monsters.cpp +++ b/dlls/monsters.cpp @@ -2023,8 +2023,6 @@ void CBaseMonster::MonsterInit( void ) SetThink( &CBaseMonster::MonsterInitThink ); pev->nextthink = gpGlobals->time + 0.1f; SetUse( &CBaseMonster::MonsterUse ); - - m_flLastYawTime = gpGlobals->time; } //========================================================= @@ -2509,9 +2507,12 @@ float CBaseMonster::ChangeYaw( int yawSpeed ) { if( monsteryawspeedfix.value ) { - float delta; + if( m_flLastYawTime == 0.f ) + m_flLastYawTime = gpGlobals->time - gpGlobals->frametime; + + float delta = Q_min( gpGlobals->time - m_flLastYawTime, 0.25f ); - delta = Q_min( gpGlobals->time - m_flLastYawTime, 0.25f ); + m_flLastYawTime = gpGlobals->time; speed = (float)yawSpeed * delta * 2; } @@ -2561,8 +2562,6 @@ float CBaseMonster::ChangeYaw( int yawSpeed ) else move = 0; - m_flLastYawTime = gpGlobals->time; - return move; } diff --git a/dlls/mpstubb.cpp b/dlls/mpstubb.cpp index 12b3a82f41..5a1b1d5b49 100644 --- a/dlls/mpstubb.cpp +++ b/dlls/mpstubb.cpp @@ -37,7 +37,7 @@ int CGraph::FindNearestNode( const Vector &vecOrigin, int afNodeTypes ) { return /*********************************************************/ void CBaseMonster::ReportAIState( void ) { } -float CBaseMonster::ChangeYaw( int speed ) { return 0; } +float CBaseMonster::ChangeYaw( int yawSpeed ) { return 0; } void CBaseMonster::MakeIdealYaw( Vector vecTarget ) { } void CBaseMonster::CorpseFallThink( void ) diff --git a/dlls/multiplay_gamerules.cpp b/dlls/multiplay_gamerules.cpp index ef2db2d5c5..d7d3f1ad8d 100644 --- a/dlls/multiplay_gamerules.cpp +++ b/dlls/multiplay_gamerules.cpp @@ -580,11 +580,6 @@ int CHalfLifeMultiplay::IPointsForKill( CBasePlayer *pAttacker, CBasePlayer *pKi //========================================================= void CHalfLifeMultiplay::PlayerKilled( CBasePlayer *pVictim, entvars_t *pKiller, entvars_t *pInflictor ) { - DeathNotice( pVictim, pKiller, pInflictor ); - - pVictim->m_iDeaths += 1; - - FireTargets( "game_playerdie", pVictim, pVictim, USE_TOGGLE, 0 ); CBasePlayer *peKiller = NULL; CBaseEntity *ktmp = CBaseEntity::Instance( pKiller ); if( ktmp && (ktmp->Classify() == CLASS_PLAYER ) ) @@ -600,6 +595,12 @@ void CHalfLifeMultiplay::PlayerKilled( CBasePlayer *pVictim, entvars_t *pKiller, } } + DeathNotice( pVictim, pKiller, pInflictor ); + + pVictim->m_iDeaths += 1; + + FireTargets( "game_playerdie", pVictim, pVictim, USE_TOGGLE, 0 ); + if( pVictim->pev == pKiller ) { // killed self @@ -1305,7 +1306,8 @@ int ReloadMapCycleFile( const char *filename, mapcycle_t *cycle ) if( com_token[0] == '\0' ) break; - strcpy( szMap, com_token ); + strncpy( szMap, com_token, sizeof( szMap ) - 1 ); + szMap[sizeof( szMap ) - 1] = '\0'; // Any more tokens on this line? if( COM_TokenWaiting( pFileList ) ) @@ -1315,7 +1317,8 @@ int ReloadMapCycleFile( const char *filename, mapcycle_t *cycle ) if( com_token[0] != '\0' ) { hasbuffer = 1; - strcpy( szBuffer, com_token ); + strncpy( szBuffer, com_token, sizeof( szBuffer ) - 1 ); + szBuffer[sizeof( szBuffer ) - 1] = '\0'; } } diff --git a/dlls/nodes.cpp b/dlls/nodes.cpp index 42ff240496..28fc7144f7 100644 --- a/dlls/nodes.cpp +++ b/dlls/nodes.cpp @@ -1587,7 +1587,7 @@ void CNodeEnt::Spawn( void ) if( WorldGraph.m_cNodes >= MAX_NODES ) { - ALERT( at_aiconsole, "cNodes > MAX_NODES\n" ); + ALERT( at_aiconsole, "cNodes >= MAX_NODES\n" ); return; } diff --git a/dlls/nodes.h b/dlls/nodes.h index cb19aeb844..becfd07bc8 100644 --- a/dlls/nodes.h +++ b/dlls/nodes.h @@ -216,7 +216,7 @@ class CGraph inline CNode &Node( int i ) { #if _DEBUG - if ( !m_pNodes || i < 0 || i > m_cNodes ) + if ( !m_pNodes || i < 0 || i >= m_cNodes ) ALERT( at_error, "Bad Node!\n" ); #endif return m_pNodes[i]; @@ -225,7 +225,7 @@ class CGraph inline CLink &Link( int i ) { #if _DEBUG - if ( !m_pLinkPool || i < 0 || i > m_cLinks ) + if ( !m_pLinkPool || i < 0 || i >= m_cLinks ) ALERT( at_error, "Bad link!\n" ); #endif return m_pLinkPool[i]; diff --git a/dlls/player.cpp b/dlls/player.cpp index bd508e3de5..f9a633da69 100644 --- a/dlls/player.cpp +++ b/dlls/player.cpp @@ -785,21 +785,35 @@ void CBasePlayer::PackDeadPlayerItems( void ) } else { - // pack the ammo - while( iPackAmmo[iPA] != -1 ) + bool bPackItems = true; + if ( iAmmoRules == GR_PLR_DROP_AMMO_ACTIVE && iWeaponRules == GR_PLR_DROP_GUN_ACTIVE ) { - pWeaponBox->PackAmmo( MAKE_STRING( CBasePlayerItem::AmmoInfoArray[iPackAmmo[iPA]].pszName ), m_rgAmmo[iPackAmmo[iPA]] ); - iPA++; + if ( rgpPackWeapons[0] == NULL + || ( FClassnameIs( rgpPackWeapons[0]->pev, "weapon_satchel" ) && ( iPackAmmo[0] == -1 || ( m_rgAmmo[iPackAmmo[0]] == 0 ) ) ) ) + { + bPackItems = false; + } } - // now pack all of the items in the lists - while( rgpPackWeapons[iPW] ) + if ( bPackItems ) { - // weapon unhooked from the player. Pack it into der box. - pWeaponBox->PackWeapon( rgpPackWeapons[iPW] ); + // pack the ammo + while( iPackAmmo[iPA] != -1 ) + { + pWeaponBox->PackAmmo( MAKE_STRING( CBasePlayerItem::AmmoInfoArray[iPackAmmo[iPA]].pszName ), m_rgAmmo[iPackAmmo[iPA]] ); + iPA++; + } - iPW++; + // now pack all of the items in the lists + while( rgpPackWeapons[iPW] ) + { + // weapon unhooked from the player. Pack it into der box. + pWeaponBox->PackWeapon( rgpPackWeapons[iPW] ); + + iPW++; + } } + pWeaponBox->pev->velocity = pev->velocity * 1.2f;// weaponbox has player's velocity, then some. } RemoveAllItems( TRUE );// now strip off everything that wasn't handled by the code above. @@ -2794,6 +2808,8 @@ edict_t *EntSelectSpawnPoint( CBaseEntity *pPlayer ) CBaseEntity *pSpot; edict_t *player; + int nNumRandomSpawnsToTry = 10; + player = pPlayer->edict(); // choose a info_player_deathmatch point @@ -2808,9 +2824,18 @@ edict_t *EntSelectSpawnPoint( CBaseEntity *pPlayer ) } else if( g_pGameRules->IsDeathmatch() ) { + if( !g_pLastSpawn ) + { + nNumRandomSpawnsToTry = 0; + CBaseEntity* pEnt = 0; + + while( ( pEnt = UTIL_FindEntityByClassname( pEnt, "info_player_deathmatch" ))) + nNumRandomSpawnsToTry++; + } + pSpot = g_pLastSpawn; // Randomize the start spot - for( int i = RANDOM_LONG( 1, 9 ); i > 0; i-- ) + for( int i = RANDOM_LONG( 1, nNumRandomSpawnsToTry - 1 ); i > 0; i-- ) pSpot = UTIL_FindEntityByClassname( pSpot, "info_player_deathmatch" ); if( FNullEnt( pSpot ) ) // skip over the null point pSpot = UTIL_FindEntityByClassname( pSpot, "info_player_deathmatch" ); @@ -4349,7 +4374,7 @@ Vector CBasePlayer::GetAutoaimVector( float flDelta ) // m_vecAutoAim = m_vecAutoAim * 0.99; // Don't send across network if sv_aim is 0 - if( g_psv_aim->value != 0 ) + if( g_psv_aim->value && g_psv_allow_autoaim && g_psv_allow_autoaim->value ) { if( m_vecAutoAim.x != m_lastx || m_vecAutoAim.y != m_lasty ) { @@ -4375,7 +4400,7 @@ Vector CBasePlayer::AutoaimDeflection( Vector &vecSrc, float flDist, float flDel edict_t *bestent; TraceResult tr; - if( g_psv_aim->value == 0 ) + if( !( g_psv_aim->value && g_psv_allow_autoaim && g_psv_allow_autoaim->value )) { m_fOnTarget = FALSE; return g_vecZero; diff --git a/dlls/rpg.cpp b/dlls/rpg.cpp index 4e39ec2c50..86ae6d2c86 100644 --- a/dlls/rpg.cpp +++ b/dlls/rpg.cpp @@ -400,7 +400,7 @@ int CRpg::GetItemInfo( ItemInfo *p ) p->iSlot = 3; p->iPosition = 0; p->iId = m_iId = WEAPON_RPG; - p->iFlags = ITEM_FLAG_NOCHOICE; + p->iFlags = ITEM_FLAG_NOAUTOSWITCHTO; p->iWeight = RPG_WEIGHT; return 1; diff --git a/dlls/scripted.cpp b/dlls/scripted.cpp index 1cfc8088a4..3673f5ade3 100644 --- a/dlls/scripted.cpp +++ b/dlls/scripted.cpp @@ -1090,7 +1090,6 @@ void CScriptedSentence::DelayThink( void ) BOOL CScriptedSentence::AcceptableSpeaker( CBaseToggle *pTarget ) { - CBaseMonster *pMonster; EHANDLE hTarget; if( pTarget ) @@ -1099,7 +1098,7 @@ BOOL CScriptedSentence::AcceptableSpeaker( CBaseToggle *pTarget ) if( hTarget != 0 ) { - CBaseMonster *pMonster = (CBaseMonster*)( (CBaseEntity*)hTarget ); + CBaseMonster* pMonster = (CBaseMonster*)( (CBaseEntity*)hTarget ); if( pev->spawnflags & SF_SENTENCE_FOLLOWERS ) { if( pMonster->m_hTargetEnt == 0 || !pMonster->m_hTargetEnt->IsPlayer() ) diff --git a/dlls/singleplay_gamerules.cpp b/dlls/singleplay_gamerules.cpp index 06ad417c3b..2dc9336da7 100644 --- a/dlls/singleplay_gamerules.cpp +++ b/dlls/singleplay_gamerules.cpp @@ -119,7 +119,7 @@ BOOL HLGetNextBestWeapon(CBasePlayer *pPlayer, CBasePlayerItem *pCurrentWeapon ) while( pCheck ) { - if( !FBitSet( pCheck->iFlags(), ITEM_FLAG_NOCHOICE )) + if( !FBitSet( pCheck->iFlags(), ITEM_FLAG_NOAUTOSWITCHTO )) { if( pCheck->iWeight() > -1 && pCheck->iWeight() == pCurrentWeapon->iWeight() && pCheck != pCurrentWeapon ) { diff --git a/dlls/triggers.cpp b/dlls/triggers.cpp index 19699786a6..dc1d946675 100644 --- a/dlls/triggers.cpp +++ b/dlls/triggers.cpp @@ -318,7 +318,7 @@ void CMultiManager::KeyValue( KeyValueData *pkvd ) { char tmp[128]; - UTIL_StripToken( pkvd->szKeyName, tmp ); + UTIL_StripToken( pkvd->szKeyName, tmp, sizeof( tmp )); m_iTargetName[m_cTargets] = ALLOC_STRING( tmp ); m_flTargetDelay[m_cTargets] = atof( pkvd->szValue ); m_cTargets++; diff --git a/dlls/util.cpp b/dlls/util.cpp index 85566cd3a6..4a9b3d7da6 100644 --- a/dlls/util.cpp +++ b/dlls/util.cpp @@ -1325,7 +1325,8 @@ void UTIL_StringToVector( float *pVector, const char *pString ) char *pstr, *pfront, tempString[128]; int j; - strcpy( tempString, pString ); + strncpy( tempString, pString, sizeof( tempString )); + tempString[sizeof( tempString ) - 1] = '\0'; pstr = pfront = tempString; for( j = 0; j < 3; j++ ) // lifted from pr_edict.c @@ -1355,7 +1356,8 @@ void UTIL_StringToIntArray( int *pVector, int count, const char *pString ) char *pstr, *pfront, tempString[128]; int j; - strcpy( tempString, pString ); + strncpy( tempString, pString, sizeof( tempString )); + tempString[sizeof( tempString ) - 1] = '\0'; pstr = pfront = tempString; for( j = 0; j < count; j++ ) // lifted from pr_edict.c @@ -1560,11 +1562,11 @@ float UTIL_DotPoints( const Vector &vecSrc, const Vector &vecCheck, const Vector //========================================================= // UTIL_StripToken - for redundant keynames //========================================================= -void UTIL_StripToken( const char *pKey, char *pDest ) +void UTIL_StripToken( const char *pKey, char *pDest, int nLen ) { int i = 0; - while( pKey[i] && pKey[i] != '#' ) + while( i < nLen - 1 && pKey[i] && pKey[i] != '#' ) { pDest[i] = pKey[i]; i++; @@ -2136,7 +2138,7 @@ int CRestore::ReadField( void *pBaseData, TYPEDESCRIPTION *pFields, int fieldCou { fieldNumber = ( i + startField ) % fieldCount; pTest = &pFields[fieldNumber]; - if( !stricmp( pTest->fieldName, pName ) ) + if( pTest->fieldName && !stricmp( pTest->fieldName, pName ) ) { if( !m_global || !(pTest->flags & FTYPEDESC_GLOBAL ) ) { diff --git a/dlls/util.h b/dlls/util.h index 1fe4d41891..0aa64802f7 100644 --- a/dlls/util.h +++ b/dlls/util.h @@ -380,7 +380,7 @@ extern void UTIL_LogPrintf( const char *fmt, ... ); // Sorta like FInViewCone, but for nonmonsters. extern float UTIL_DotPoints ( const Vector &vecSrc, const Vector &vecCheck, const Vector &vecDir ); -extern void UTIL_StripToken( const char *pKey, char *pDest );// for redundant keynames +extern void UTIL_StripToken( const char *pKey, char *pDest, int nLen );// for redundant keynames // Misc functions extern void SetMovedir(entvars_t* pev); diff --git a/dlls/weapons.h b/dlls/weapons.h index 4db8381f31..aea4a62822 100644 --- a/dlls/weapons.h +++ b/dlls/weapons.h @@ -183,7 +183,7 @@ typedef enum #define ITEM_FLAG_NOAUTOSWITCHEMPTY 4 #define ITEM_FLAG_LIMITINWORLD 8 #define ITEM_FLAG_EXHAUSTIBLE 16 // A player can totally exhaust their ammo supply and lose this weapon -#define ITEM_FLAG_NOCHOICE 32 +#define ITEM_FLAG_NOAUTOSWITCHTO 32 #define WEAPON_IS_ONTARGET 0x40 diff --git a/dlls/wscript b/dlls/wscript index 82d9e87038..58b07b2e80 100644 --- a/dlls/wscript +++ b/dlls/wscript @@ -54,7 +54,6 @@ def build(bld): includes = includes, defines = defines, install_path = install_path, - subsystem = bld.env.MSVC_SUBSYSTEM, idx = bld.get_taskgen_count() ) diff --git a/pm_shared/pm_shared.c b/pm_shared/pm_shared.c index 922c7ca6d2..2396c9cd97 100644 --- a/pm_shared/pm_shared.c +++ b/pm_shared/pm_shared.c @@ -946,7 +946,10 @@ int PM_FlyMove( void ) // modify original_velocity so it parallels all of the clip planes // - if( pmove->movetype == MOVETYPE_WALK && ( ( pmove->onground == -1 ) || ( pmove->friction != 1 ) ) ) // relfect player velocity + // reflect player velocity + // Only give this a try for first impact plane because you can get yourself stuck in an acute corner by jumping in place + // and pressing forward and nobody was really using this bounce/reflection feature anyway... + if( numplanes == 1 && pmove->movetype == MOVETYPE_WALK && ( ( pmove->onground == -1 ) || ( pmove->friction != 1 ))) { for( i = 0; i < numplanes; i++ ) { @@ -2860,6 +2863,15 @@ void PM_CheckParamters( void ) pmove->maxspeed = min( maxspeed, pmove->maxspeed ); } + // Slow down, I'm pulling it! (a box maybe) but only when I'm standing on ground + // + // JoshA: Moved this to CheckParamters rather than working on the velocity, + // as otherwise it affects every integration step incorrectly. + if( ( pmove->onground != -1 ) && ( pmove->cmd.buttons & IN_USE )) + { + pmove->maxspeed *= 1.0f / 3.0f; + } + if( ( spd != 0.0f ) && ( spd > pmove->maxspeed ) ) { float fRatio = pmove->maxspeed / spd; @@ -2980,7 +2992,11 @@ void PM_PlayerMove( qboolean server ) { if( PM_CheckStuck() ) { - return; // Can't move, we're stuck + // Let the user try to duck to get unstuck + PM_Duck(); + + if( PM_CheckStuck() ) + return; // Can't move, we're stuck } } @@ -3026,12 +3042,6 @@ void PM_PlayerMove( qboolean server ) } } - // Slow down, I'm pulling it! (a box maybe) but only when I'm standing on ground - if( ( pmove->onground != -1 ) && ( pmove->cmd.buttons & IN_USE ) ) - { - VectorScale( pmove->velocity, 0.3, pmove->velocity ); - } - // Handle movement switch( pmove->movetype ) { diff --git a/public/build.h b/public/build.h index 851939b557..24fd9d5bbf 100644 --- a/public/build.h +++ b/public/build.h @@ -81,10 +81,13 @@ Then you can use another oneliner to query all variables: #undef XASH_RISCV_SINGLEFP #undef XASH_RISCV_SOFTFP #undef XASH_SERENITY +#undef XASH_SUNOS #undef XASH_WIN32 #undef XASH_X86 #undef XASH_NSWITCH #undef XASH_PSVITA +#undef XASH_WASI +#undef XASH_WASM //================================================================ // @@ -126,6 +129,10 @@ Then you can use another oneliner to query all variables: #define XASH_NSWITCH 1 #elif defined __vita__ #define XASH_PSVITA 1 + #elif defined __wasi__ + #define XASH_WASI 1 + #elif defined __sun__ + #define XASH_SUNOS 1 #else #error #endif @@ -234,10 +241,19 @@ Then you can use another oneliner to query all variables: #else #error "Unknown RISC-V float ABI" #endif +#elif defined __wasm__ + #if defined __wasm64__ + #define XASH_64BIT 1 + #endif + #define XASH_WASM 1 #else #error "Place your architecture name here! If this is a mistake, try to fix conditions above and report a bug" #endif +#if !XASH_64BIT && ( defined( __LP64__ ) || defined( _LP64 )) +#define XASH_64BIT 1 +#endif + #if XASH_ARM == 8 #define XASH_ARMv8 1 #elif XASH_ARM == 7 diff --git a/scripts/waifulib/library_naming.py b/scripts/waifulib/library_naming.py index ac2faf6f9f..dc5f13ee1d 100644 --- a/scripts/waifulib/library_naming.py +++ b/scripts/waifulib/library_naming.py @@ -60,6 +60,8 @@ 'XASH_X86', 'XASH_NSWITCH', 'XASH_PSVITA', +'XASH_WASI', +'XASH_SUNOS', ] def configure(conf): @@ -75,8 +77,12 @@ def configure(conf): # engine/common/build.c if conf.env.XASH_ANDROID: buildos = "android" - elif conf.env.XASH_WIN32 or conf.env.XASH_LINUX or conf.env.XASH_APPLE: - buildos = "" # no prefix for default OS + elif conf.env.XASH_WIN32: + buildos = "win32" + elif conf.env.XASH_LINUX: + buildos = "linux" + elif conf.env.XASH_APPLE: + buildos = "apple" elif conf.env.XASH_FREEBSD: buildos = "freebsd" elif conf.env.XASH_NETBSD: @@ -97,6 +103,10 @@ def configure(conf): buildos = "psvita" elif conf.env.XASH_IRIX: buildos = "irix" + elif conf.env.XASH_WASI: + buildos = "wasi" + elif conf.env.XASH_SUNOS: + buildos = "sunos" else: conf.fatal("Place your operating system name in build.h and library_naming.py!\n" "If this is a mistake, try to fix conditions above and report a bug") @@ -104,10 +114,7 @@ def configure(conf): if conf.env.XASH_AMD64: buildarch = "amd64" elif conf.env.XASH_X86: - if conf.env.XASH_WIN32 or conf.env.XASH_LINUX or conf.env.XASH_APPLE: - buildarch = "" - else: - buildarch = "i386" + buildarch = "i386" elif conf.env.XASH_ARM and conf.env.XASH_64BIT: buildarch = "arm64" elif conf.env.XASH_ARM: @@ -160,6 +167,14 @@ def configure(conf): raise conf.fatal("Place your architecture name in build.h and library_naming.py!\n" "If this is a mistake, try to fix conditions above and report a bug") + node = conf.bldnode.make_node('true_postfix.txt') + node.write('%s-%s' % (buildos, buildarch)) + + if not conf.env.XASH_ANDROID and (conf.env.XASH_WIN32 or conf.env.XASH_LINUX or conf.env.XASH_APPLE): + buildos = '' + if conf.env.XASH_X86: + buildarch = '' + conf.env.revert() if buildos == 'android': diff --git a/wscript b/wscript index be199f58c5..a934c6259d 100644 --- a/wscript +++ b/wscript @@ -2,7 +2,7 @@ # encoding: utf-8 # a1batross, mittorn, 2018 -from waflib import Build, Configure, Context, Logs +from waflib import Build, Configure, Context, Logs, TaskGen import sys import os import re @@ -20,6 +20,12 @@ def get_taskgen_count(self): except: idx = 0 # don't set tg_idx_count to not increase counter return idx +@TaskGen.feature('cshlib', 'cxxshlib', 'fcshlib') +@TaskGen.before_method('apply_implib') +def remove_implib_install(self): + if not getattr(self, 'install_path_implib', None): + self.install_path_implib = None + def options(opt): opt.load('reconfigure compiler_optimizations xcompile compiler_cxx compiler_c clang_compilation_database strip_on_install msdev msvs subproject') @@ -41,14 +47,8 @@ def configure(conf): conf.load('fwgslib reconfigure compiler_optimizations') conf.env.MSVC_TARGETS = ['x86' if not conf.options.ALLOW64 else 'x64'] - # Force XP compatibility, all build targets should add subsystem=bld.env.MSVC_SUBSYSTEM - if conf.env.MSVC_TARGETS[0] == 'x86': - conf.env.MSVC_SUBSYSTEM = 'WINDOWS,5.01' - else: - conf.env.MSVC_SUBSYSTEM = 'WINDOWS' - # Load compilers early - conf.load('xcompile compiler_c compiler_cxx') + conf.load('xcompile compiler_c compiler_cxx gccdeps') # HACKHACK: override msvc DEST_CPU value by something that we understand if conf.env.DEST_CPU == 'amd64': @@ -63,8 +63,7 @@ def configure(conf): if conf.env.GIT_BRANCH: conf.define('XASH_BUILD_BRANCH', conf.env.GIT_BRANCH) - enforce_pic = True # modern defaults - conf.check_pic(enforce_pic) + conf.check_pic(True) # modern defaults # We restrict 64-bit builds ONLY for Win/Linux/OSX running on Intel architecture # Because compatibility with original GoldSrc