From dc8ee0a7ddd28874da33fb47e212805cae745e84 Mon Sep 17 00:00:00 2001 From: James Mitchell Date: Wed, 20 May 2020 21:39:50 +1000 Subject: [PATCH] Adding missing parts from vscript Alien Swarm port --- sp/src/game/client/c_baseentity.cpp | 2 ++ sp/src/game/server/point_template.cpp | 4 ++-- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/sp/src/game/client/c_baseentity.cpp b/sp/src/game/client/c_baseentity.cpp index 10415ab5..a6e2072c 100644 --- a/sp/src/game/client/c_baseentity.cpp +++ b/sp/src/game/client/c_baseentity.cpp @@ -1106,6 +1106,8 @@ bool C_BaseEntity::Init( int entnum, int iSerialNum ) m_nCreationTick = gpGlobals->tickcount; + m_hScriptInstance = NULL; + return true; } diff --git a/sp/src/game/server/point_template.cpp b/sp/src/game/server/point_template.cpp index 940b501c..c6a09ea6 100644 --- a/sp/src/game/server/point_template.cpp +++ b/sp/src/game/server/point_template.cpp @@ -347,7 +347,7 @@ bool CPointTemplate::CreateInstance( const Vector &vecOrigin, const QAngle &vecA // Some templates have Entity I/O connecting the entities within the template. // Unique versions of these templates need to be created whenever they're instanced. - if ( AllowNameFixup() && Templates_IndexRequiresEntityIOFixup( iTemplateIndex ) ) + if ( AllowNameFixup() && ( Templates_IndexRequiresEntityIOFixup( iTemplateIndex ) || m_ScriptScope.IsInitialized() ) ) { // This template requires instancing. // Create a new mapdata block and ask the template system to fill it in with @@ -436,7 +436,7 @@ bool CPointTemplate::CreateSpecificInstance( int iTemplate, const Vector &vecOri // Some templates have Entity I/O connecting the entities within the template. // Unique versions of these templates need to be created whenever they're instanced. - if ( AllowNameFixup() && Templates_IndexRequiresEntityIOFixup( iTemplateIndex ) ) + if ( AllowNameFixup() && ( Templates_IndexRequiresEntityIOFixup( iTemplateIndex ) || m_ScriptScope.IsInitialized() ) ) { // This template requires instancing. // Create a new mapdata block and ask the template system to fill it in with