mirror of
https://github.com/celisej567/source-sdk-2013.git
synced 2026-09-11 20:11:33 +03:00
Mapbase v6.1
- Added postprocess_controller entity from later versions of Source - Added env_dof_controller entity from later versions of Source - Added SDK_Engine_Post and DepthOfField shaders from the Momentum repo/Alien Swarm SDK - Fixed auto-breaking game_text/choreo text not null terminating - Fixed console groups showing up at the wrong developer levels - Added more mesages to console groups, including a new "NPC AI" console group - Fixed typos and added elaboration in various cvars, console messages, etc. - Fixed npc_metropolice not using frag grenades correctly when allowed to use them - Fixed npc_metropolice not registering stitching squad slots in AI - Fixed SetModel input late precache warning - Fixed env_global_light angles resetting upon loading a save - Fixed an issue with ScriptKeyValuesRead using the wrong name and having a memory leak - Allowed VScript functions which return null strings to actually return null instead of empty strings - Added VScript member variable documentation - Fixed VScript documentation lines sometimes mixing together - Fixed VScript singletons having a ! at the beginning of descriptions - Added Color struct to VScript and allowed color-related inputs to use it - Added more VScript functions for weapons, ammo, ragdolling, and response contexts - Added GameRules singleton for VScript - Exposed AI interaction system to VScript - Recovered some lost documentation from older revisions of the Mapbase wiki - Added a way to get the current game's load type in VScript - Fixed Precache/SpawnEntityFromTable not accounting for a few important field types - Added VScript functions for getting a player's eye vectors - Fixed a crash caused by removing the active weapon of a Combine soldier while it's firing - Changed the way metrocops deploy their manhacks so they could use their manhack death response properly - Fixed "Use Server" keyvalue on game_convar_mod not working - Adjusted CAI_Expresser in VScript
This commit is contained in:
@@ -802,7 +802,10 @@ void PushVariant(HSQUIRRELVM vm, const ScriptVariant_t& value)
|
||||
sq_pushfloat(vm, value);
|
||||
break;
|
||||
case FIELD_CSTRING:
|
||||
sq_pushstring(vm, value, -1);
|
||||
if ( value.m_pszString )
|
||||
sq_pushstring(vm, value, -1);
|
||||
else
|
||||
sq_pushnull(vm);
|
||||
break;
|
||||
case FIELD_VECTOR:
|
||||
{
|
||||
@@ -1453,9 +1456,6 @@ void RegisterClassDocumentation(HSQUIRRELVM vm, const ScriptClassDesc_t* pClassD
|
||||
{
|
||||
SquirrelSafeCheck safeCheck(vm);
|
||||
|
||||
if (pClassDesc->m_pszDescription && pClassDesc->m_pszDescription[0] == SCRIPT_HIDE[0])
|
||||
return;
|
||||
|
||||
const char *name = pClassDesc->m_pszScriptName;
|
||||
const char *base = "";
|
||||
if (pClassDesc->m_pBaseDesc)
|
||||
@@ -1463,6 +1463,19 @@ void RegisterClassDocumentation(HSQUIRRELVM vm, const ScriptClassDesc_t* pClassD
|
||||
base = pClassDesc->m_pBaseDesc->m_pszScriptName;
|
||||
}
|
||||
|
||||
const char *description = pClassDesc->m_pszDescription;
|
||||
if (description)
|
||||
{
|
||||
if (description[0] == SCRIPT_HIDE[0])
|
||||
return;
|
||||
if (description[0] == SCRIPT_SINGLETON[0])
|
||||
description++;
|
||||
}
|
||||
else
|
||||
{
|
||||
description = "";
|
||||
}
|
||||
|
||||
// RegisterClassHelp(name, base, description)
|
||||
sq_pushroottable(vm);
|
||||
sq_pushstring(vm, "RegisterClassHelp", -1);
|
||||
@@ -1471,7 +1484,7 @@ void RegisterClassDocumentation(HSQUIRRELVM vm, const ScriptClassDesc_t* pClassD
|
||||
sq_pushroottable(vm);
|
||||
sq_pushstring(vm, name, -1);
|
||||
sq_pushstring(vm, base, -1);
|
||||
sq_pushstring(vm, pClassDesc->m_pszDescription ? pClassDesc->m_pszDescription : "", -1);
|
||||
sq_pushstring(vm, description, -1);
|
||||
sq_call(vm, 4, SQFalse, SQFalse);
|
||||
sq_pop(vm, 1);
|
||||
}
|
||||
@@ -1492,8 +1505,9 @@ void RegisterEnumDocumentation(HSQUIRRELVM vm, const ScriptEnumDesc_t* pClassDes
|
||||
sq_remove(vm, -2);
|
||||
sq_pushroottable(vm);
|
||||
sq_pushstring(vm, name, -1);
|
||||
sq_pushinteger(vm, pClassDesc->m_ConstantBindings.Count());
|
||||
sq_pushstring(vm, pClassDesc->m_pszDescription ? pClassDesc->m_pszDescription : "", -1);
|
||||
sq_call(vm, 3, SQFalse, SQFalse);
|
||||
sq_call(vm, 4, SQFalse, SQFalse);
|
||||
sq_pop(vm, 1);
|
||||
}
|
||||
|
||||
@@ -1577,6 +1591,41 @@ void RegisterHookDocumentation(HSQUIRRELVM vm, const ScriptHook_t* pHook, const
|
||||
sq_pop(vm, 1);
|
||||
}
|
||||
|
||||
void RegisterMemberDocumentation(HSQUIRRELVM vm, const ScriptMemberDesc_t& pDesc, ScriptClassDesc_t* pClassDesc = nullptr)
|
||||
{
|
||||
SquirrelSafeCheck safeCheck(vm);
|
||||
|
||||
if (pDesc.m_pszDescription && pDesc.m_pszDescription[0] == SCRIPT_HIDE[0])
|
||||
return;
|
||||
|
||||
char name[256] = "";
|
||||
|
||||
if (pClassDesc)
|
||||
{
|
||||
V_strcat_safe(name, pClassDesc->m_pszScriptName);
|
||||
V_strcat_safe(name, ".");
|
||||
}
|
||||
|
||||
if (pDesc.m_pszScriptName)
|
||||
V_strcat_safe(name, pDesc.m_pszScriptName);
|
||||
|
||||
|
||||
char signature[256] = "";
|
||||
V_snprintf(signature, sizeof(signature), "%s %s", ScriptDataTypeToName(pDesc.m_ReturnType), name);
|
||||
|
||||
// RegisterHookHelp(name, signature, description)
|
||||
sq_pushroottable(vm);
|
||||
sq_pushstring(vm, "RegisterMemberHelp", -1);
|
||||
sq_get(vm, -2);
|
||||
sq_remove(vm, -2);
|
||||
sq_pushroottable(vm);
|
||||
sq_pushstring(vm, name, -1);
|
||||
sq_pushstring(vm, signature, -1);
|
||||
sq_pushstring(vm, pDesc.m_pszDescription ? pDesc.m_pszDescription : "", -1);
|
||||
sq_call(vm, 4, SQFalse, SQFalse);
|
||||
sq_pop(vm, 1);
|
||||
}
|
||||
|
||||
|
||||
bool SquirrelVM::Init()
|
||||
{
|
||||
@@ -2091,6 +2140,13 @@ bool SquirrelVM::RegisterClass(ScriptClassDesc_t* pClassDesc)
|
||||
RegisterHookDocumentation(vm_, scriptHook, scriptHook->m_desc, pClassDesc);
|
||||
}
|
||||
|
||||
for (int i = 0; i < pClassDesc->m_Members.Count(); ++i)
|
||||
{
|
||||
auto& member = pClassDesc->m_Members[i];
|
||||
|
||||
RegisterMemberDocumentation(vm_, member, pClassDesc);
|
||||
}
|
||||
|
||||
sq_pushstring(vm_, pClassDesc->m_pszScriptName, -1);
|
||||
sq_push(vm_, -2);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user