Fixed G_Find

This commit is contained in:
Dino 2023-09-04 20:48:16 -04:00
parent bf2072258b
commit 1d1ec76b6b
2 changed files with 9 additions and 7 deletions

View file

@ -2952,20 +2952,20 @@ void GetSpawnPoints (void)
num_potential_spawns = 0;
if ((spot = G_Find (spot, FOFS (classname), "info_player_team1")) != NULL)
if ((spot = G_FindByString<&edict_t::classname>(spot, "info_player_team1") != nullptr))
{
potential_spawns[num_potential_spawns] = spot;
num_potential_spawns++;
}
if ((spot = G_Find (spot, FOFS (classname), "info_player_team2")) != NULL)
if ((spot = G_FindByString<&edict_t::classname>(spot, "info_player_team2") != nullptr))
{
potential_spawns[num_potential_spawns] = spot;
num_potential_spawns++;
}
spot = NULL;
while ((spot = G_Find (spot, FOFS (classname), "info_player_deathmatch")) != NULL)
spot = nullptr;
while ((spot = G_FindByString<&edict_t::classname>(spot, "info_player_deathmatch") != nullptr))
{
potential_spawns[num_potential_spawns] = spot;
num_potential_spawns++;

View file

@ -3977,19 +3977,21 @@ edict_t *FindSpecWeapSpawn(edict_t* ent)
edict_t* spot = NULL;
//gi.bprintf (PRINT_HIGH, "Calling the FindSpecWeapSpawn\n");
spot = G_Find(spot, FOFS(classname), ent->classname);
spot = G_FindByString<&edict_t::classname>(spot, classname);
//spot = G_Find(spot, FOFS(classname), ent->classname);
//gi.bprintf (PRINT_HIGH, "spot = %p and spot->think = %p and playerholder = %p, spot, (spot ? spot->think : 0), PlaceHolder\n");
while (spot && spot->think != PlaceHolder) //(spot->spawnflags & DROPPED_ITEM ) && spot->think != PlaceHolder )//spot->solid == SOLID_NOT )
{
// gi.bprintf (PRINT_HIGH, "Calling inside the loop FindSpecWeapSpawn\n");
spot = G_Find(spot, FOFS(classname), ent->classname);
spot = G_FindByString<&edict_t::classname>(spot, classname);
//spot = G_Find(spot, FOFS(classname), ent->classname);
}
return spot;
}
static void SpawnSpecWeap(gitem_t* item, edict_t* spot)
{
SetRespawn(spot, 1);
SetRespawn(spot, 60_sec, false);
gi.linkentity(spot);
}