From 30c57b17b468e21f84e16f59b1d87d38255b009d Mon Sep 17 00:00:00 2001 From: Aaron Dean <8dino2@gmail.com> Date: Wed, 6 Sep 2023 15:22:15 -0400 Subject: [PATCH] Trying to remove more dependencies from xatrix and rogue --- actionlite/CMakeLists.txt | 4 ++-- actionlite/g_combat.cpp | 18 +++++++-------- actionlite/g_items.cpp | 2 ++ actionlite/g_local.h | 8 +++---- actionlite/g_main.cpp | 10 ++++---- actionlite/g_monster.cpp | 12 +++++----- actionlite/g_spawn.cpp | 10 ++++---- actionlite/p_client.cpp | 48 +++++++++++++++++++-------------------- actionlite/p_hud.cpp | 10 ++++---- actionlite/p_view.cpp | 14 ++++++------ 10 files changed, 69 insertions(+), 67 deletions(-) diff --git a/actionlite/CMakeLists.txt b/actionlite/CMakeLists.txt index 5df5378..3da6554 100644 --- a/actionlite/CMakeLists.txt +++ b/actionlite/CMakeLists.txt @@ -38,8 +38,8 @@ set(GAME_SRC ${CMAKE_CURRENT_SOURCE_DIR}/g_utils.cpp ${CMAKE_CURRENT_SOURCE_DIR}/g_weapon.cpp ${CMAKE_CURRENT_SOURCE_DIR}/m_actor.cpp - ${CMAKE_CURRENT_SOURCE_DIR}/m_infantry.cpp - ${CMAKE_CURRENT_SOURCE_DIR}/m_medic.cpp + # ${CMAKE_CURRENT_SOURCE_DIR}/m_infantry.cpp + # ${CMAKE_CURRENT_SOURCE_DIR}/m_medic.cpp ${CMAKE_CURRENT_SOURCE_DIR}/m_move.cpp ${CMAKE_CURRENT_SOURCE_DIR}/p_client.cpp ${CMAKE_CURRENT_SOURCE_DIR}/p_hud.cpp diff --git a/actionlite/g_combat.cpp b/actionlite/g_combat.cpp index 336de0b..97f66d5 100644 --- a/actionlite/g_combat.cpp +++ b/actionlite/g_combat.cpp @@ -538,16 +538,16 @@ void T_Damage(edict_t *targ, edict_t *inflictor, edict_t *attacker, const vec3_t // ROGUE // allow the deathmatch game to change values - if (deathmatch->integer && gamerules->integer) - { - if (DMGame.ChangeDamage) - damage = DMGame.ChangeDamage(targ, attacker, damage, mod); - if (DMGame.ChangeKnockback) - knockback = DMGame.ChangeKnockback(targ, attacker, knockback, mod); + // if (deathmatch->integer && gamerules->integer) + // { + // if (DMGame.ChangeDamage) + // damage = DMGame.ChangeDamage(targ, attacker, damage, mod); + // if (DMGame.ChangeKnockback) + // knockback = DMGame.ChangeKnockback(targ, attacker, knockback, mod); - if (!damage) - return; - } + // if (!damage) + // return; + // } // ROGUE // easy mode takes half damage diff --git a/actionlite/g_items.cpp b/actionlite/g_items.cpp index 5973d5f..6739204 100644 --- a/actionlite/g_items.cpp +++ b/actionlite/g_items.cpp @@ -1112,6 +1112,8 @@ void SpawnItem(edict_t *ent, gitem_t *item) // // ROGUE // //===== // } + } + if (g_no_health->integer) { if (item->flags & IF_HEALTH) diff --git a/actionlite/g_local.h b/actionlite/g_local.h index c3d5217..12fba2b 100644 --- a/actionlite/g_local.h +++ b/actionlite/g_local.h @@ -2716,10 +2716,10 @@ void PredictAim(edict_t *self, edict_t *target, const vec3_t &start, float bolt_ bool M_CalculatePitchToFire(edict_t *self, const vec3_t &target, const vec3_t &start, vec3_t &aim, float speed, float time_remaining, bool mortar, bool destroy_on_touch = false); bool below(edict_t *self, edict_t *other); void drawbbox(edict_t *self); -void M_MonsterDodge(edict_t *self, edict_t *attacker, gtime_t eta, trace_t *tr, bool gravity); -void monster_duck_down(edict_t *self); -void monster_duck_hold(edict_t *self); -void monster_duck_up(edict_t *self); +//void M_MonsterDodge(edict_t *self, edict_t *attacker, gtime_t eta, trace_t *tr, bool gravity); +// void monster_duck_down(edict_t *self); +// void monster_duck_hold(edict_t *self); +// void monster_duck_up(edict_t *self); bool has_valid_enemy(edict_t *self); //void TargetTesla(edict_t *self, edict_t *tesla); //void hintpath_stop(edict_t *self); diff --git a/actionlite/g_main.cpp b/actionlite/g_main.cpp index f8087b8..f2122e3 100644 --- a/actionlite/g_main.cpp +++ b/actionlite/g_main.cpp @@ -782,11 +782,11 @@ void CheckDMRules() //======= // ROGUE - if (gamerules->integer && DMGame.CheckDMRules) - { - if (DMGame.CheckDMRules()) - return; - } + // if (gamerules->integer && DMGame.CheckDMRules) + // { + // if (DMGame.CheckDMRules()) + // return; + // } // ROGUE //======= diff --git a/actionlite/g_monster.cpp b/actionlite/g_monster.cpp index bd9d6c4..785fb9c 100644 --- a/actionlite/g_monster.cpp +++ b/actionlite/g_monster.cpp @@ -44,12 +44,12 @@ void monster_fire_blaster(edict_t *self, const vec3_t &start, const vec3_t &dir, monster_muzzleflash(self, start, flashtype); } -void monster_fire_flechette(edict_t *self, const vec3_t &start, const vec3_t &dir, int damage, int speed, - monster_muzzleflash_id_t flashtype) -{ - fire_flechette(self, start, dir, damage, speed, damage / 2); - monster_muzzleflash(self, start, flashtype); -} +// void monster_fire_flechette(edict_t *self, const vec3_t &start, const vec3_t &dir, int damage, int speed, +// monster_muzzleflash_id_t flashtype) +// { +// fire_flechette(self, start, dir, damage, speed, damage / 2); +// monster_muzzleflash(self, start, flashtype); +// } void monster_fire_grenade(edict_t *self, const vec3_t &start, const vec3_t &aimdir, int damage, int speed, monster_muzzleflash_id_t flashtype, float right_adjust, float up_adjust) diff --git a/actionlite/g_spawn.cpp b/actionlite/g_spawn.cpp index da55852..0e526d4 100644 --- a/actionlite/g_spawn.cpp +++ b/actionlite/g_spawn.cpp @@ -1259,11 +1259,11 @@ void SpawnEntities(const char *mapname, const char *entities, const char *spawnp // ROGUE // ROGUE -- allow dm games to do init stuff right before game starts. - if (deathmatch->integer && gamerules->integer) - { - if (DMGame.PostInitSetup) - DMGame.PostInitSetup(); - } + // if (deathmatch->integer && gamerules->integer) + // { + // if (DMGame.PostInitSetup) + // DMGame.PostInitSetup(); + // } // ROGUE setup_shadow_lights(); diff --git a/actionlite/p_client.cpp b/actionlite/p_client.cpp index 1a90731..d31e519 100644 --- a/actionlite/p_client.cpp +++ b/actionlite/p_client.cpp @@ -1388,11 +1388,11 @@ DIE(player_die) (edict_t *self, edict_t *inflictor, edict_t *attacker, int damag } } - if (gamerules->integer) // if we're in a dm game, alert the game - { - if (DMGame.PlayerDeath) - DMGame.PlayerDeath(self, inflictor, attacker); - } + // if (gamerules->integer) // if we're in a dm game, alert the game + // { + // if (DMGame.PlayerDeath) + // DMGame.PlayerDeath(self, inflictor, attacker); + // } // remove powerups self->client->quad_time = 0_ms; @@ -2767,8 +2767,8 @@ void PutClientInServer(edict_t *ent) spawn_angles = squad_respawn_angles; valid_spawn = true; } - else if (gamerules->integer && DMGame.SelectSpawnPoint) // PGM - valid_spawn = DMGame.SelectSpawnPoint(ent, spawn_origin, spawn_angles, force_spawn); // PGM + // else if (gamerules->integer && DMGame.SelectSpawnPoint) // PGM + // valid_spawn = DMGame.SelectSpawnPoint(ent, spawn_origin, spawn_angles, force_spawn); // PGM else // PGM valid_spawn = SelectSpawnPoint(ent, spawn_origin, spawn_angles, force_spawn, is_landmark); @@ -3072,10 +3072,10 @@ void ClientBeginDeathmatch(edict_t *ent) InitClientResp(ent->client); // PGM - if (gamerules->integer && DMGame.ClientBegin) - { - DMGame.ClientBegin(ent); - } + // if (gamerules->integer && DMGame.ClientBegin) + // { + // DMGame.ClientBegin(ent); + // } // PGM // locate ent at a spawn point @@ -3695,21 +3695,21 @@ void ClientDisconnect(edict_t *ent) //============ // ROGUE // make sure no trackers are still hurting us. - if (ent->client->tracker_pain_time) - RemoveAttackingPainDaemons(ent); + // if (ent->client->tracker_pain_time) + // RemoveAttackingPainDaemons(ent); - if (ent->client->owned_sphere) - { - if (ent->client->owned_sphere->inuse) - G_FreeEdict(ent->client->owned_sphere); - ent->client->owned_sphere = nullptr; - } + // if (ent->client->owned_sphere) + // { + // if (ent->client->owned_sphere->inuse) + // G_FreeEdict(ent->client->owned_sphere); + // ent->client->owned_sphere = nullptr; + // } - if (gamerules->integer) - { - if (DMGame.PlayerDisconnect) - DMGame.PlayerDisconnect(ent); - } + // if (gamerules->integer) + // { + // if (DMGame.PlayerDisconnect) + // DMGame.PlayerDisconnect(ent); + // } // ROGUE //============ diff --git a/actionlite/p_hud.cpp b/actionlite/p_hud.cpp index efae538..2aab825 100644 --- a/actionlite/p_hud.cpp +++ b/actionlite/p_hud.cpp @@ -460,11 +460,11 @@ void DeathmatchScoreboardMessage(edict_t *ent, edict_t *killer) //=============== // ROGUE // allow new DM games to override the tag picture - if (gamerules->integer) - { - if (DMGame.DogTag) - DMGame.DogTag(cl_ent, killer, &tag); - } + // if (gamerules->integer) + // { + // if (DMGame.DogTag) + // DMGame.DogTag(cl_ent, killer, &tag); + // } // ROGUE //=============== diff --git a/actionlite/p_view.cpp b/actionlite/p_view.cpp index 6ec431b..1523497 100644 --- a/actionlite/p_view.cpp +++ b/actionlite/p_view.cpp @@ -883,14 +883,14 @@ void G_SetClientEffects(edict_t *ent) //========= // PGM - if (ent->flags & FL_DISGUISED) - ent->s.renderfx |= RF_USE_DISGUISE; + // if (ent->flags & FL_DISGUISED) + // ent->s.renderfx |= RF_USE_DISGUISE; - if (gamerules->integer) - { - if (DMGame.PlayerEffects) - DMGame.PlayerEffects(ent); - } + // if (gamerules->integer) + // { + // if (DMGame.PlayerEffects) + // DMGame.PlayerEffects(ent); + // } // PGM //=========