Fix Alien Slave beams not clearing upon gib/removal.

Fix env_smoker showing as func_wall.
Fix pev->message field not working on many entities.
Fix monstermaker "soundlist" keyvalue not working.
Add prisoner spawnflag (16) for monstermaker.
Add poison damage to spore grenades.
Increase max entities from 512 to 768.
Increase max spawnpoints from 256 to 384.
This commit is contained in:
Giegue
2024-01-21 14:46:32 -03:00
parent 9f77e10934
commit f035b865e5
8 changed files with 55 additions and 19 deletions

View File

@@ -632,6 +632,7 @@ public:
void IdleSound( void );
void Killed( entvars_t *pevAttacker, int iGib );
void UpdateOnRemove();
void StartTask ( Task_t *pTask );
Schedule_t *GetSchedule( void );

View File

@@ -715,6 +715,7 @@ edict_t* spawn_monster(int monster_type, Vector origin, Vector angles, int spawn
case 33: monsters[monster_index].pMonster = CreateClassPtr((CMAmbientMusic *)NULL); break;
case 34: monsters[monster_index].pMonster = CreateClassPtr((CMXenMaker *)NULL); break;
case 35: monsters[monster_index].pMonster = CreateClassPtr((CMSetCVar *)NULL); break;
default: LOG_MESSAGE(PLID, "ERROR: Invalid monster type! (%i)", monster_type); return NULL;
}
if (monsters[monster_index].pMonster == NULL)
@@ -1243,6 +1244,28 @@ void SpawnViewerCommand(void)
LOG_MESSAGE(PLID, "spawns a node viewer at the player's location");
}
void DebugGetEntities(void)
{
LOG_MESSAGE(PLID, "count: %i ents of max %i\n", monster_ents_used, MAX_MONSTER_ENTS);
for (int index = 0; index < MAX_MONSTER_ENTS; index++)
{
if (monsters[index].monster_index)
{
LOG_MESSAGE(PLID, "SLOT #%i:", index);
edict_t *pent = (*g_engfuncs.pfnPEntityOfEntIndex)(monsters[index].monster_index);
if (pent)
{
LOG_MESSAGE(PLID, "Class is \"%s\"\n", STRING(pent->v.classname));
}
else
{
LOG_MESSAGE(PLID, "NULL entity\n");
}
}
}
}
void mmGameDLLInit( void )
{
// one time initialization stuff here...
@@ -1446,6 +1469,7 @@ void mmServerActivate( edict_t *pEdictList, int edictCount, int clientMax )
(g_engfuncs.pfnAddServerCommand)("monster", MonsterCommand);
(g_engfuncs.pfnAddServerCommand)("node_viewer", SpawnViewerCommand);
(g_engfuncs.pfnAddServerCommand)("get_edicts", DebugGetEntities);
(g_engfuncs.pfnAddServerCommand)("_use", mmDispatchUse);
for (index = 0; monster_types[index].name[0]; index++)

View File

@@ -97,6 +97,7 @@ void CSmoker::Spawn( void )
UTIL_SetSize(pev, g_vecZero, g_vecZero );
pev->effects |= EF_NODRAW;
pev->angles = g_vecZero;
pev->classname = MAKE_STRING("env_smoker");
}
void CSmoker::Think( void )

View File

@@ -168,6 +168,12 @@ void CMISlave::Killed( entvars_t *pevAttacker, int iGib )
CMBaseMonster::Killed( pevAttacker, iGib );
}
void CMISlave::UpdateOnRemove()
{
CMBaseMonster::UpdateOnRemove();
ClearBeams();
}
//=========================================================
// SetYawSpeed - allows each sequence to have a different
// turn rate associated with it.

View File

@@ -133,7 +133,6 @@ void process_monster_sound(edict_t *pMonster, char *fileName)
// SC soundlist path starts from sound/MAPNAME
sprintf(srPath, "%s/sound/%s/%s", game_dir, STRING(gpGlobals->mapname), fileName);
if (access(srPath, 0) == 0)
{
if ((fp = fopen(srPath, "r")) != NULL)
@@ -450,13 +449,13 @@ void scan_monster_cfg(FILE *fp)
{
// precache the sound here
PRECACHE_GENERIC(data[i].value);
}
// the entity will need the keyvalue
// common pev-field, an entity might need it
strcpy(monster_spawnpoint[monster_spawn_count].keyvalue[i].key, data[i].key);
strcpy(monster_spawnpoint[monster_spawn_count].keyvalue[i].value, data[i].value);
}
}
}
else
{
// We do not know this keyvalue, but an specific entity might use it.
@@ -828,13 +827,13 @@ void scan_monster_bsp(void)
{
// precache the sound here
PRECACHE_GENERIC(data[i].value);
}
// the entity will need the keyvalue
// common pev-field, an entity might need it
strcpy(monster_spawnpoint[monster_spawn_count].keyvalue[i].key, data[i].key);
strcpy(monster_spawnpoint[monster_spawn_count].keyvalue[i].value, data[i].value);
}
}
}
else
{
// We do not know this keyvalue, but an specific entity might use it.

View File

@@ -30,7 +30,7 @@ typedef struct
CMBaseMonster *pMonster;
} monster_t;
#define MAX_MONSTER_ENTS 512
#define MAX_MONSTER_ENTS 768
extern monster_t monsters[MAX_MONSTER_ENTS];
@@ -43,7 +43,7 @@ typedef struct {
bool need_to_respawn;
} monster_spawnpoint_t;
#define MAX_MONSTERS 256
#define MAX_MONSTERS 384
extern monster_spawnpoint_t monster_spawnpoint[MAX_MONSTERS];
// this is here to store if a node we want to spawn is an ordinary one, or a flying one

View File

@@ -28,6 +28,7 @@
#define SF_MONSTERMAKER_START_ON 1 // start active ( if has targetname )
#define SF_MONSTERMAKER_CYCLIC 4 // drop one monster every time fired.
#define SF_MONSTERMAKER_MONSTERCLIP 8 // Children are blocked by monsterclip
#define SF_MONSTERMAKER_PRISONER 16 // children won't attack or be attacked
extern monster_type_t monster_types[];
extern edict_t* spawn_monster(int monster_type, Vector origin, Vector angles, int spawnflags, pKVD *keyvalue);
@@ -171,7 +172,7 @@ void CMMonsterMaker::MakeMonster( void )
}
edict_t *pent;
pKVD keyvalue[MAX_KEYVALUES]; // sometimes, i don't know what am i doing. -Giegue
pKVD keyvalue[MAX_KEYVALUES];
int createSF = SF_MONSTER_FALL_TO_GROUND;
if ( m_iMaxLiveChildren > 0 && m_cLiveChildren >= m_iMaxLiveChildren )
@@ -205,6 +206,10 @@ void CMMonsterMaker::MakeMonster( void )
if ( pev->spawnflags & SF_MONSTERMAKER_MONSTERCLIP )
createSF |= SF_MONSTER_HITMONSTERCLIP;
// Should children be prisoner entities?
if (pev->spawnflags & SF_MONSTERMAKER_PRISONER)
createSF |= SF_MONSTER_PRISONER;
/* KEYVALUES */
// Monster is to have a custom model?
if ( !FStringNull( m_iszCustomModel ) )
@@ -284,13 +289,13 @@ void CMMonsterMaker::MakeMonster( void )
pent->v.rendercolor = pev->rendercolor;
// Soundlist isn't "exactly" a keyvalue so pass it here
if ( m_srSoundList != NULL )
if (m_srSoundList != NULL)
{
// it needs to be allocated first
CMBaseMonster *pChild = GetClassPtr((CMBaseMonster *)VARS(pent));
pChild->m_srSoundList = (REPLACER::REPLACER*)calloc(MAX_REPLACEMENTS, sizeof(*pChild->m_srSoundList));
memcpy(pChild->m_srSoundList, m_srSoundList, sizeof(REPLACER::REPLACER));
memcpy(pChild->m_srSoundList, m_srSoundList, m_isrSounds * sizeof(*pChild->m_srSoundList));
pChild->m_isrSounds = m_isrSounds;
}

View File

@@ -107,7 +107,7 @@ void CMSporeGrenade::Explode(TraceResult *pTrace)
pev->owner = NULL; // can't traceline attack owner if this is set
RadiusDamage(pev, pevOwner, pev->dmg, CLASS_NONE, DMG_BLAST);
RadiusDamage(pev, pevOwner, pev->dmg, CLASS_NONE, DMG_BLAST | DMG_POISON);
// Place a decal on the surface that was hit.
UTIL_DecalTrace(pTrace, DECAL_SPIT1 + RANDOM_LONG(0, 1));