From 1d1ec76b6b26a68b157763f37bb6a1ba57bd0c3d Mon Sep 17 00:00:00 2001 From: Dino <8dino2@gmail.com> Date: Mon, 4 Sep 2023 20:48:16 -0400 Subject: [PATCH] Fixed G_Find --- actionlite/a_team.cpp | 8 ++++---- actionlite/p_weapon.cpp | 8 +++++--- 2 files changed, 9 insertions(+), 7 deletions(-) diff --git a/actionlite/a_team.cpp b/actionlite/a_team.cpp index 660ce76..425ad3f 100644 --- a/actionlite/a_team.cpp +++ b/actionlite/a_team.cpp @@ -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++; diff --git a/actionlite/p_weapon.cpp b/actionlite/p_weapon.cpp index f798bbe..f3c8e5c 100644 --- a/actionlite/p_weapon.cpp +++ b/actionlite/p_weapon.cpp @@ -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); }