fix(CI): replace --64bits with --32bits

fix(Build): Add missing mapbase functions.
This commit is contained in:
tupoy-ya 2024-12-30 20:40:24 +05:00
parent 0f77a83026
commit dba14e2dc1
4 changed files with 149 additions and 8 deletions

View File

@ -10,7 +10,7 @@ jobs:
fail-fast: false
matrix:
os: [ubuntu-latest]
bits: ['', '--64bits']
bits: ['', '--32bits']
android: ['']
flags: ['', '-d']
include:
@ -82,20 +82,20 @@ jobs:
run: brew install sdl2
- name: Configure
run: ./waf configure --64bits ${{ matrix.flags }} $WAF_FLAGS
run: ./waf configure ${{ matrix.flags }} $WAF_FLAGS
- name: Build macos-amd64
run: ./waf install --strip-to-file
- name: Upload build
uses: actions/upload-artifact@v3
with:
name: macOS--64bits${{matrix.flags}}${{matrix.android}}
name: macOS${{matrix.flags}}${{matrix.android}}
path: |
build_hl2
!build_hl2/**/*.dSYM
- name: Upload debug symbols
uses: actions/upload-artifact@v3
with:
name: debug-macOS--64bits${{matrix.flags}}${{matrix.android}}
name: debug-macOS${{matrix.flags}}${{matrix.android}}
path: |
build_hl2/**/*.dSYM
@ -104,7 +104,7 @@ jobs:
fail-fast: false
matrix:
os: [windows-2019]
bits: ['', '--64bits']
bits: ['', '--32bits']
flags: ['', '-d']
runs-on: ${{ matrix.os }}
steps:

View File

@ -9,7 +9,7 @@ jobs:
strategy:
matrix:
os: [ubuntu-latest, ubuntu-20.04]
bits: ['', '--64bits']
bits: ['', '--32bits']
android: ['']
runs-on: ${{ matrix.os }}
env:
@ -51,7 +51,7 @@ jobs:
submodules: recursive
- name: Configure
run: ./waf configure --64bits $WAF_FLAGS
run: ./waf configure $WAF_FLAGS
- name: Build macos-amd64
run: ./waf install
- name: Run tests
@ -63,7 +63,7 @@ jobs:
strategy:
matrix:
os: [windows-2019]
bits: ['', '--64bits']
bits: ['', '--32bits']
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v3

View File

@ -64,6 +64,10 @@
#include "tier1/mapbase_con_groups.h"
#include "utlhashtable.h"
#ifdef MAPBASE_VSCRIPT
#include "mapbase/matchers.h"
#endif
#if defined( TF_DLL )
#include "tf_gamerules.h"
#endif
@ -7112,6 +7116,131 @@ int CBaseEntity::FindContextByName( const char *name ) const
return -1;
}
#ifdef MAPBASE_VSCRIPT
//-----------------------------------------------------------------------------
// Purpose: Searches entity for named context string and/or value.
// Intended to be called by entities rather than the conventional response system.
// Input : *name - Context name.
// *value - Context value. (optional)
// Output : bool
//-----------------------------------------------------------------------------
bool CBaseEntity::HasContext( const char *name, const char *value ) const
{
int c = m_ResponseContexts.Count();
for ( int i = 0; i < c; i++ )
{
if ( Matcher_NamesMatch( name, STRING(m_ResponseContexts[i].m_iszName) ) )
{
if (value == NULL)
return true;
else
return Matcher_Match(STRING(m_ResponseContexts[i].m_iszValue), value);
}
}
return false;
}
//-----------------------------------------------------------------------------
// Purpose: Searches entity for named context string and/or value.
// Intended to be called by entities rather than the conventional response system.
// Input : *name - Context name.
// *value - Context value. (optional)
// Output : bool
//-----------------------------------------------------------------------------
bool CBaseEntity::HasContext( string_t name, string_t value ) const
{
int c = m_ResponseContexts.Count();
for ( int i = 0; i < c; i++ )
{
if ( name == m_ResponseContexts[i].m_iszName )
{
if (value == NULL_STRING)
return true;
else
return value == m_ResponseContexts[i].m_iszValue;
}
}
return false;
}
//-----------------------------------------------------------------------------
// Purpose: Searches entity for named context string and/or value.
// Intended to be called by entities rather than the conventional response system.
// Input : *nameandvalue - Context name and value.
// Output : bool
//-----------------------------------------------------------------------------
bool CBaseEntity::HasContext( const char *nameandvalue ) const
{
char key[ 128 ];
char value[ 128 ];
const char *p = nameandvalue;
while ( p )
{
p = SplitContext( p, key, sizeof( key ), value, sizeof( value ), NULL );
return HasContext( key, value );
}
return false;
}
//-----------------------------------------------------------------------------
// Purpose:
// Input : index -
// Output : const char
//-----------------------------------------------------------------------------
const char *CBaseEntity::GetContextValue( const char *contextName ) const
{
int idx = FindContextByName( contextName );
if ( idx == -1 )
return "";
return m_ResponseContexts[ idx ].m_iszValue.ToCStr();
}
//-----------------------------------------------------------------------------
//-----------------------------------------------------------------------------
float CBaseEntity::GetContextExpireTime( const char *name )
{
int idx = FindContextByName( name );
if ( idx == -1 )
return 0.0f;
return m_ResponseContexts[ idx ].m_fExpirationTime;
}
//-----------------------------------------------------------------------------
// Purpose: Internal method or removing contexts and can remove multiple contexts in one call
// Input : *contextName -
//-----------------------------------------------------------------------------
void CBaseEntity::RemoveContext( const char *contextName )
{
char key[ 128 ];
char value[ 128 ];
float duration;
const char *p = contextName;
while ( p )
{
duration = 0.0f;
p = SplitContext( p, key, sizeof( key ), value, sizeof( value ), &duration );
if ( duration )
{
duration += gpGlobals->curtime;
}
int iIndex = FindContextByName( key );
if ( iIndex != -1 )
{
m_ResponseContexts.Remove( iIndex );
}
}
}
#endif
//-----------------------------------------------------------------------------
// Purpose:
// Input : inputdata -

View File

@ -909,6 +909,18 @@ protected:
const char *GetContextValue( int index ) const; // note: context may be expired
bool ContextExpired( int index ) const;
int FindContextByName( const char *name ) const;
#ifdef MAPBASE_VSCRIPT
public:
bool HasContext( const char *name, const char *value ) const;
bool HasContext( string_t name, string_t value ) const; // NOTE: string_t version only compares pointers!
bool HasContext( const char *nameandvalue ) const;
const char *GetContextValue( const char *contextName ) const;
float GetContextExpireTime( const char *name );
void RemoveContext( const char *nameandvalue );
#endif
public:
void AddContext( const char *nameandvalue );
void AddContext( const char *name, const char *value, float duration = 0.0f );