Add missing keyvalue in monstermaker.
Fix duplicate entity spawn in Half-Life.
This commit is contained in:
@@ -450,11 +450,11 @@ void scan_monster_bsp(void)
|
|||||||
{
|
{
|
||||||
// the entity we are trying to spawn could already exist within the game
|
// the entity we are trying to spawn could already exist within the game
|
||||||
// use the engine's CREATE_NAMED_ENTITY to see if it's valid or not
|
// use the engine's CREATE_NAMED_ENTITY to see if it's valid or not
|
||||||
//
|
|
||||||
// if it is valid, this entity already exists and we should ignore it
|
|
||||||
edict_t *existsGAME = CREATE_NAMED_ENTITY( MAKE_STRING( kv_pair->value ) );
|
edict_t *existsGAME = CREATE_NAMED_ENTITY( MAKE_STRING( kv_pair->value ) );
|
||||||
if ( !FNullEnt( existsGAME ) )
|
if ( !FNullEnt( existsGAME ) )
|
||||||
{
|
{
|
||||||
|
// this entity already exists and we should ignore it
|
||||||
|
|
||||||
// use REMOVE_ENTITY instead of UTIL_Remove!
|
// use REMOVE_ENTITY instead of UTIL_Remove!
|
||||||
// UTIL_Remove sets FL_KILLME to remove the entity on the next frame, that won't do.
|
// UTIL_Remove sets FL_KILLME to remove the entity on the next frame, that won't do.
|
||||||
// REMOVE_ENTITY instead removes it instantly, which is needed to prevent server crashes
|
// REMOVE_ENTITY instead removes it instantly, which is needed to prevent server crashes
|
||||||
@@ -467,10 +467,16 @@ void scan_monster_bsp(void)
|
|||||||
else if (strcmp(kv_pair->key, "use_monstermod") == 0)
|
else if (strcmp(kv_pair->key, "use_monstermod") == 0)
|
||||||
{
|
{
|
||||||
if (atoi(kv_pair->value) == 1)
|
if (atoi(kv_pair->value) == 1)
|
||||||
|
{
|
||||||
|
// The extra plugin must be available to handle the old entity!
|
||||||
|
if (CVAR_GET_FLOAT("_hl_explicit"))
|
||||||
{
|
{
|
||||||
// EXPLICITY requested to use monstermod for this entity
|
// EXPLICITY requested to use monstermod for this entity
|
||||||
use_monstermod_explicit = true;
|
use_monstermod_explicit = true;
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
LOG_MESSAGE(PLID, "WARNING: can't explicity add entity #%i - add-on plugin unavailable", ent);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
strcpy(data[kvd_index].key, kv_pair->key);
|
strcpy(data[kvd_index].key, kv_pair->key);
|
||||||
|
|||||||
@@ -70,6 +70,12 @@ void CMMonsterMaker :: KeyValue( KeyValueData *pkvd )
|
|||||||
m_iMonsterBlood = atoi(pkvd->szValue);
|
m_iMonsterBlood = atoi(pkvd->szValue);
|
||||||
pkvd->fHandled = TRUE;
|
pkvd->fHandled = TRUE;
|
||||||
}
|
}
|
||||||
|
else if ( FStrEq(pkvd->szKeyName, "respawn_as_playerally") )
|
||||||
|
{
|
||||||
|
if (atoi(pkvd->szValue))
|
||||||
|
m_iClassifyOverride = CLASS_PLAYER_ALLY;
|
||||||
|
pkvd->fHandled = TRUE;
|
||||||
|
}
|
||||||
// These are to keep consistency with Sven Co-op's squadmaker entity.
|
// These are to keep consistency with Sven Co-op's squadmaker entity.
|
||||||
// CMBaseMonster::KeyValue will process TriggerCondition/TriggerTarget
|
// CMBaseMonster::KeyValue will process TriggerCondition/TriggerTarget
|
||||||
// keyvalues in the same way.
|
// keyvalues in the same way.
|
||||||
|
|||||||
Reference in New Issue
Block a user