Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 0 additions & 2 deletions scripting/include/srccoop.inc
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
#if defined SRCCOOP_HL2DM

#define CHECK_ENGINE "HL2DM"; if (GetEngineVersion() != Engine_HL2DM)
#define OUTPUT_SEPARATOR ","
#define INTRO_TIMER_HUDTEXT

#define ENTPATCH_CUSTOM_NPC_MODELS
Expand Down Expand Up @@ -59,7 +58,6 @@
#define SRCCOOP_BLACKMESA
#endif
#define CHECK_ENGINE "Black Mesa"; if (GetEngineVersion() != Engine_BlackMesa)
#define OUTPUT_SEPARATOR "\27"

#define ENTPATCH_CUSTOM_NPC_MODELS
#define ENTPATCH_UPDATE_ENEMY_MEMORY
Expand Down
23 changes: 17 additions & 6 deletions scripting/include/srccoop/levellump.inc
Original file line number Diff line number Diff line change
Expand Up @@ -27,12 +27,20 @@ enum struct CEntityOutputLump
float m_flDelay;
int m_iTimesToFire;

char m_szDelimiter[2];

bool LoadFromEntityKeyLump(const CEntityKeyLump pEntityKeyLump)
{
char buffers[5][MAX_VALUE];
if (sizeof(buffers) != ExplodeString(pEntityKeyLump.m_szValue, OUTPUT_SEPARATOR, buffers, sizeof(buffers), sizeof(buffers[])))

this.m_szDelimiter = "\27"; // 'ESC'
if (sizeof(buffers) != ExplodeString(pEntityKeyLump.m_szValue, this.m_szDelimiter, buffers, sizeof(buffers), sizeof(buffers[])))
{
return false;
this.m_szDelimiter = ",";
if (sizeof(buffers) != ExplodeString(pEntityKeyLump.m_szValue, this.m_szDelimiter, buffers, sizeof(buffers), sizeof(buffers[])))
{
return false;
}
}
if (!StringToFloatEx(buffers[3], this.m_flDelay))
{
Expand All @@ -50,11 +58,14 @@ enum struct CEntityOutputLump

void SaveToEntityKeyLump(CEntityKeyLump pEntityKeyLump)
{
if (this.m_szDelimiter[0] == EOS)
this.m_szDelimiter = "\27"; // default to 'ESC'

FormatEx(pEntityKeyLump.m_szValue, sizeof(pEntityKeyLump.m_szValue), "%s%s%s%s%s%s%.2f%s%d",
this.m_szTargetEntity, OUTPUT_SEPARATOR,
this.m_szInputName, OUTPUT_SEPARATOR,
this.m_szParameter, OUTPUT_SEPARATOR,
this.m_flDelay, OUTPUT_SEPARATOR,
this.m_szTargetEntity, this.m_szDelimiter,
this.m_szInputName, this.m_szDelimiter,
this.m_szParameter, this.m_szDelimiter,
this.m_flDelay, this.m_szDelimiter,
this.m_iTimesToFire);
}

Expand Down