mirror of
https://github.com/celisej567/source-sdk-2013.git
synced 2026-09-17 20:10:21 +03:00
Mapbase v5.1
- Fixed a major oversight in Source 2013 which was causing some code to think all logic entities were worldspawn - Added WIP background nodraw for point_cameras set to not draw skybox at all - Fixed map-specific talker not flushing on restore - Added optional HUD hint to code-based game instructor hints - Added workaround for suspicious crashes in HL2 NPC rappelling code (reported by 1upD) - Made antlions summoned by npc_antlionguard report as dead when removed with the "Kill" input - Fixed math_mod not saving mod value (reported by Klems) - Added SDK_WindowImposter, which uses the SteamPipe cubemap bug workaround and includes support for parallax corrected cubemaps - Updated thirdpartylegalnotices.txt to mention the Squirrel API - Fixed incorrect type checking for script instances in VScript - Added a bunch of new misc. VScript constants - Added a few new base VScript functions - Added a separate "Clientside Script Language" keyvalue to worldspawn for VScript, allowing client scripts to use a different language from server scripts - Fixed worldspawn crashing the game when running entity scripts (reported by krassell) - Fixed manifests creating a second worldspawn, allowing them to function properly in HL2 - Added tons of remapping-related fixes for instances and manifests, including node IDs and overlay remapping - Added a keyvalue to func_instance which allows vector axis lines to be remapped properly - Added support for manifest root path instances in VBSP - Added missing PrintBrushContents() contents to VBSP - Added -nohiddenmaps parameter - Made manifest cordon somewhat functional
This commit is contained in:
@@ -12,6 +12,9 @@
|
||||
#include "filesystem_tools.h"
|
||||
#include "tier1/strtools.h"
|
||||
#include "utlmap.h"
|
||||
#ifdef MAPBASE
|
||||
#include "fmtstr.h"
|
||||
#endif
|
||||
|
||||
// memdbgon must be the last include file in a .cpp file!!!
|
||||
#include "tier0/memdbgon.h"
|
||||
@@ -579,6 +582,34 @@ GDclass *GameData::BeginInstanceRemap( const char *pszClassName, const char *psz
|
||||
return m_InstanceClass;
|
||||
}
|
||||
|
||||
#ifdef MAPBASE
|
||||
//-----------------------------------------------------------------------------
|
||||
// Purpose: Sets up for additional instance remap fixes from Mapbase
|
||||
//-----------------------------------------------------------------------------
|
||||
void GameData::SetupInstanceRemapParams( int iStartNodes, int iStartBrushSide, bool bRemapVecLines )
|
||||
{
|
||||
// Set the numer of nodes in the level
|
||||
m_InstanceStartAINodes = iStartNodes;
|
||||
|
||||
// If we have a "nodeid" key, set it to ivNodeDest so it's properly recognized
|
||||
// during AI node remapping
|
||||
GDinputvariable *var = m_InstanceClass->VarForName( "nodeid" );
|
||||
if ( var )
|
||||
{
|
||||
var->ForceSetType( ivNodeDest );
|
||||
}
|
||||
|
||||
//---------------------------------------------
|
||||
|
||||
// Set the number of brush sides in the level
|
||||
m_InstanceStartSide = iStartBrushSide;
|
||||
|
||||
//---------------------------------------------
|
||||
|
||||
m_bRemapVecLines = bRemapVecLines;
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
enum tRemapOperation
|
||||
{
|
||||
@@ -586,6 +617,13 @@ enum tRemapOperation
|
||||
REMAP_POSITION,
|
||||
REMAP_ANGLE,
|
||||
REMAP_ANGLE_NEGATIVE_PITCH,
|
||||
#ifdef MAPBASE
|
||||
// Remaps the node ID for instance/manifest AI node support
|
||||
REMAP_NODE_ID,
|
||||
|
||||
// Remaps brush sides and sidelists
|
||||
REMAP_SIDES,
|
||||
#endif
|
||||
};
|
||||
|
||||
|
||||
@@ -624,6 +662,12 @@ bool GameData::RemapKeyValue( const char *pszKey, const char *pszInValue, char *
|
||||
RemapOperation.Insert( ivOrigin, REMAP_POSITION );
|
||||
RemapOperation.Insert( ivAxis, REMAP_ANGLE );
|
||||
RemapOperation.Insert( ivAngleNegativePitch, REMAP_ANGLE_NEGATIVE_PITCH );
|
||||
#ifdef MAPBASE
|
||||
RemapOperation.Insert( ivNodeDest, REMAP_NODE_ID );
|
||||
RemapOperation.Insert( ivSide, REMAP_SIDES );
|
||||
RemapOperation.Insert( ivSideList, REMAP_SIDES );
|
||||
RemapOperation.Insert( ivVecLine, REMAP_POSITION );
|
||||
#endif
|
||||
}
|
||||
|
||||
if ( !m_InstanceClass )
|
||||
@@ -657,6 +701,12 @@ bool GameData::RemapKeyValue( const char *pszKey, const char *pszInValue, char *
|
||||
|
||||
case REMAP_POSITION:
|
||||
{
|
||||
#ifdef MAPBASE
|
||||
// Only remap ivVecLine if the keyvalue is enabled
|
||||
if (KVType == ivVecLine && !m_bRemapVecLines)
|
||||
break;
|
||||
#endif
|
||||
|
||||
Vector inPoint( 0.0f, 0.0f, 0.0f ), outPoint;
|
||||
|
||||
sscanf ( pszInValue, "%f %f %f", &inPoint.x, &inPoint.y, &inPoint.z );
|
||||
@@ -697,6 +747,54 @@ bool GameData::RemapKeyValue( const char *pszKey, const char *pszInValue, char *
|
||||
sprintf( pszOutValue, "%g", -outAngles.x ); // just the pitch
|
||||
}
|
||||
break;
|
||||
|
||||
#ifdef MAPBASE
|
||||
case REMAP_NODE_ID:
|
||||
{
|
||||
int value = atoi( pszInValue );
|
||||
if (value == -1)
|
||||
break;
|
||||
|
||||
//Warning( " %s %s: Remapped %i to %i", m_InstanceClass->GetName(), KVVar->GetName(), value, value + m_InstanceStartAINodes );
|
||||
|
||||
value += m_InstanceStartAINodes;
|
||||
|
||||
sprintf( pszOutValue, "%i", value );
|
||||
}
|
||||
break;
|
||||
|
||||
case REMAP_SIDES:
|
||||
{
|
||||
CUtlStringList sideList;
|
||||
V_SplitString( pszInValue, " ", sideList );
|
||||
|
||||
// Convert sides
|
||||
CUtlStringList newSideList;
|
||||
for (int i = 0; i < sideList.Count(); i++)
|
||||
{
|
||||
int iSide = atoi( sideList[i] );
|
||||
|
||||
//Warning( " %s %s: Remapped %i to %i", m_InstanceClass->GetName(), KVVar->GetName(), iSide, iSide + m_InstanceStartSide );
|
||||
|
||||
iSide += m_InstanceStartSide;
|
||||
|
||||
newSideList.AddToTail( const_cast<char*>( CNumStr( iSide ).String() ) );
|
||||
}
|
||||
|
||||
// Initial side
|
||||
strcpy( pszOutValue, newSideList[0] );
|
||||
|
||||
// Start at 1 for subsequent sides
|
||||
for (int i = 1; i < newSideList.Count(); i++)
|
||||
{
|
||||
// Any subsequent sides are spaced
|
||||
sprintf( pszOutValue, "%s %s", pszOutValue, newSideList[i] );
|
||||
}
|
||||
|
||||
//Warning("Old side list: \"%s\", new side list: \"%s\"\n", pszInValue, pszOutValue);
|
||||
}
|
||||
break;
|
||||
#endif
|
||||
}
|
||||
|
||||
return ( strcmpi( pszInValue, pszOutValue ) != 0 );
|
||||
|
||||
Reference in New Issue
Block a user